Salve a tutti.
Fino a poco tempo fa, usavo per il mio portale un template molto banale , questo aveva al suo interno uno slidershow.
In questo slidershow, potevo scegliere che tipo di categorie potevano apparire, io usavo "tutte le categorie"
Quindi ogni mio post che scrivevo appariva nello slidershow a prescindere dalla sua categoria.
Ora ho comprato un template , tale template ha modificato non solo l'estetica del sito, ma anche il pannello dell'amministratore, aggiungendo oltre agli articoli (nella barra sinistra dell'amministratore) anche recensioni,sider,portfilo.
Il problema è questo: lo slidershow di questo template USA SOLAMENTE articoli scritti dentro la casella "slider" e questi articoli NON appaiono nella index, ma in /siders/
Per me è un problema, perchè gli articoli scritti nel siders NON appaiono neppure nel forum col cross-posting (ovvero l'opzione che ogni articolo che scrivi si copia sul forum compresi i commenti)
Quindi, vorrei modificare il file slider per far in modo che faccia apparire anche gli articoli o solo eventuali categorie impostate negli articoli.
Il vecchio slidershow era cosi:
Il nuovo slidershow appare cosi:Codice:<?php $avtheme_slider_options = get_option('avtheme_slider_options'); $avtheme_mobile_options = get_option('avtheme_mobile'); global $is_mobile; if(!$is_mobile || !$avtheme_mobile_options['hide_slider']): if(!($avtheme_slider_options['slider_number'])) { $avtheme_slider_options['slider_number'] = 5; } $query_args = array ( 'post_type' => 'post', 'posts_per_page' => $avtheme_slider_options['slider_number'], 'orderby' => 'date', 'order' => 'DESC', ); if(is_numeric($avtheme_slider_options['slider_category'])) { $query_args['cat'] = $avtheme_slider_options['slider_category']; } $slider_posts = new WP_Query ($query_args); ?> <div class="flexslider flex-<?php echo $avtheme_slider_options['slider']; ?>"> <ul class="slides"> <?php if ($slider_posts->have_posts()) : while ($slider_posts->have_posts()) : $slider_posts->the_post(); if (has_post_thumbnail() ) { global $is_mobile; if( $avtheme_slider_options['slider'] == 'large' && !$is_mobile) { $image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'slider-thumbnail'); } else { $image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'slider-small'); } ?> <li> <a href="<?php the_permalink(); ?>"><img src="<?php echo $image_url[0]; ?>" title="<?php the_title(); ?>" alt="<?php the_title(); ?>" /></a> <div class="flex-caption"><h2 class="flex-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2><div class="flex-excerpt"><?php avtheme_excerpt($post, 15); ?></div></div> </li> <?php } endwhile; endif; wp_reset_postdata(); ?> </ul> </div> <script> jQuery('.flexslider').flexslider({ controlNav: false, animation: "fade", slideshowSpeed: 5000, start: function(){ } }); </script> <?php endif; ?>
Codice:<div id="slider" class="nivoSlider"> <?php $posts_counter = 0; ?> <?php query_posts("post_type=slider&posts_per_page=-1&post_status=publish"); while ( have_posts() ) : the_post(); $posts_counter++; ?> <?php $custom = get_post_custom($post->ID); $url = get_post_custom_values("my_slider_url"); $sl_image_url = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'slider-post-thumbnail'); $tab_title = get_post_custom_values("tab-title"); ?> <?php if(has_post_thumbnail( $the_ID) || $sl_thumb!=""){ ?> <?php if($url!=""){ ?> <?php echo "<a href='" . $url[0] . "'>"; echo "<img src='"; echo $sl_image_url[0]; echo "' alt='"; echo $tab_title[0]; echo "' title='#sliderCaption" . $posts_counter . "' />"; echo "</a>"; ?> <?php }else{ ?> <?php echo "<img src='"; echo $sl_image_url[0]; echo "' alt='"; echo $tab_title[0]; echo "' title='#sliderCaption" . $posts_counter . "' />"; ?> <?php } ?> <?php } ?> <?php endwhile; ?> <?php wp_reset_query();?> </div> <?php $posts_counter = 0; ?> <?php query_posts("post_type=slider&posts_per_page=-1&post_status=publish"); while ( have_posts() ) : the_post(); $posts_counter++; ?> <?php $custom = get_post_custom($post->ID); $caption = get_post_custom_values("my_slider_caption"); ?> <div id="sliderCaption<?php echo $posts_counter ?>" class="nivo-html-caption"> <?php echo stripslashes(htmlspecialchars_decode($caption[0])); ?> </div> <?php endwhile; ?> <?php wp_reset_query();?>

LinkBack URL
About LinkBacks
