Flexslider by category.
-
Hi Guys,
I,ve started using Flexslider in my WordPress installation and I want the slider to display images from certain categories. So far I’ve sorted this but it seems that each time I post with a Featured Image the Flexslider picks that one as well.
Here’s my bit of code.
<div class="flexslider"> <ul class="slides"> <?php $category = get_option('category_name'); $args = array( 'numberposts' => 6, 'category' => 'Tappeti','eBay', 'post__in' => $category ); $postQuery = get_posts($args); foreach( $postQuery as $post ) : setup_postdata($post); if ( has_post_thumbnail() ) { ?> <li> <a href="<?php echo get_permalink(); ?>" title="Go to <?php echo the_title(); ?>" rel="bookmark"> <?php the_post_thumbnail('feature-slider'); ?> <p class="flex-caption"><?php the_title(); ?></p></a> </li> <?php } endforeach; ?> </ul> </div>
Which bit of code am I missing not to display all featured images, but only to display from the specified categories?
Thanks in advance,
Cheers.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Flexslider by category.’ is closed to new replies.