Results 1 to 1 of 1

Thread: Ad Slider - only Ads that have a (thumbnail) image?

  1. #1
    Thread Starter
    Amateur holon's Avatar
    Join Date
    Mar 2011
    Location
    Europe
    Posts
    14
    Thanks
    6
    Thanked 3 Times in 2 Posts

    Ad Slider - only Ads that have a (thumbnail) image?

    Hi there,

    on my classipress site, ad posting is free and there are no featured ads, so the ad slider shows all ads by default. What i want: The Ad Slider should only show ads, that have an image/thumbnail attached. My Question: How can i do that?

    I found this: "../classipress/includes/theme-functions.php" ...and tried with query, but dont really know how to do it right


    Code:
    /**
     * 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;
    }
    Greetings Holon

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Events list - Show featured image thumbnail instead of calendar thumbnail
    By cllzor in forum Vantage General Discussion (Legacy)
    Replies: 8
    Last Post: January 19th, 2016, 03:02 AM
  2. Increase Feature Slider Thumbnail Size classipress 3.3?
    By sandeepbp21 in forum ClassiPress General Discussion
    Replies: 3
    Last Post: May 12th, 2013, 01:47 PM
  3. Increase Feature Slider Thumbnail Size?
    By amirgulamali in forum ClassiPress General Discussion
    Replies: 3
    Last Post: May 6th, 2013, 08:02 PM
  4. Remove small image thumbnail when using only 1 image.
    By maggisam in forum ClassiPress General Discussion
    Replies: 3
    Last Post: April 25th, 2010, 05:46 PM