Can someone help - featured slider $args
I need to know how I can adapt the featured slider array to pull posts from individual categories only.
Since the 3.3.1 upgrade the method of getting this info has now changed and what ever I try doesn't work.
This used to work but doesn't anymore:
<?php query_posts( array ('ad_cat' => 'trade-sellers', 'post__in' => get_option('sticky_posts'), 'post_type' => APP_POST_TYPE, 'post_status' => 'publish', 'orderby' => 'rand') ); ?>
The code below is now standard in cp3.3.1 which pulls in all featured/sticky posts to the slider.
I have put the slider in each category and it makes sense to me that the slider should only show ads relevant to the category it is showing on.
/**
* Returns ads which are marked as featured for slider
*/
function cp_get_featured_slider_ads() {
$args = array(
'post_type' => APP_POST_TYPE,
'post_status' => 'publish',
'post__in' => get_option('sticky_posts'),
'posts_per_page' => 15,
'orderby' => 'rand',
'suppress_filters' => false,
);
$args = apply_filters( 'cp_featured_slider_args', $args );
$featured = new WP_Query( $args );
if ( ! $featured->have_posts() )
return false;
return $featured;
}
Regards
Bleem