html - how i can do featured post slider set category based? -
my featured post slider set tags. want set category base. how can it?my site http://techgajot.com featured post slider html code?
<script type="text/javascript"> //<![cdata[ jquery(window).load(function() { jquery('#featured').flexslider({ slideshowspeed: 6000, directionnav:false, pauseonhover:true, manualcontrols: '.flexslide-custom-controls li a', controlscontainer: '.container' }); }); //]]> </script> <div class="featured"> <div class="container"> <div id="featured" class="flexslider"> <ul class="slides"> <?php $count = 1; $featurecount = get_option('solostream_features_number'); $my_query = new wp_query("tag=featured&showposts=$featurecount"); while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate[] = $post->id; ?> <li id="narrow-feature-post-<?php echo $count; ?>"<?php echo solostream_featureclass(); ?>> <div class="slide-container clearfix"> <?php if ( get_post_meta( $post->id, 'video_embed', true ) ) { ?> <div class="feature-video"> <div class="video"><?php echo get_post_meta( $post->id, 'video_embed', true ); ?></div> </div> <?php } else { ?> <div class="feature-image"> <a href="<?php the_permalink() ?>" rel="<?php _e("bookmark", "solostream"); ?>" title="<?php _e("permanent link to", "solostream"); ?> <?php the_title(); ?>"><?php solostream_feature_image(); ?></a> </div> <?php } ?> <div class="flex-caption"> <div class="excerpt"> <h2 class="post-title"><a href="<?php the_permalink() ?>" rel="nofollow" title="<?php _e("permanent link to", "solostream"); ?> <?php the_title(); ?>"><?php the_title(); ?></a></h2> <?php if ( 'post' == get_post_type() ) { ?> <?php include (templatepath . "/postinfo.php"); ?> <?php } ?> <?php the_excerpt(); ?> <p class="readmore"><a class="more-link" href="<?php the_permalink() ?>" rel="nofollow" title="<?php _e("permanent link to", "solostream"); ?> <?php the_title(); ?>"><?php _e("সম্পূর্ন অংশ", "solostream"); ?></a></p> </div> </div> </div> </li> <?php $count = $count + 1 ?> <?php endwhile; ?> </ul> </div> <div class="controls-container clearfix"> <ul class="flexslide-custom-controls clearfix"> <?php $count = 1; $featurecount = get_option('solostream_features_number'); $my_query = new wp_query("tag=featured&showposts=$featurecount"); while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate[] = $post->id; ?> <li><a href="#" title="<?php the_title(); ?>"><?php echo $count; ?></a></li> <?php $count = $count + 1 ?> <?php endwhile; ?> </ul> </div> </div> </div>
how can it. featured post slider tags now= featured. when put "featured" post tags option show featured post. want category base. select here category.then category post show featured post.
if understood right ( difficult ike @dda noted ) changing line :
$my_query = new wp_query("tag=featured&showposts=$featurecount");
to
$my_query = new wp_query("category_name=featured&showposts=$featurecount");
will make same query tag category using name ..
if use id ,
$query = new wp_query( 'cat=2,7,23,35' );
or posts share category :
$query = new wp_query( 'category_name=staff' );
read more here on codex
Comments
Post a Comment