slider posts hidden in rss feed but still showing in google reader?

Community Forums Forums General Discussion slider posts hidden in rss feed but still showing in google reader?

This topic is: not resolved

This topic contains 2 replies, has 2 voices, and was last updated by  davidh55 1 year, 11 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #9499

    davidh55
    Participant
    Post count: 3

    I am using the genesis framework with legacy theme and “genesis responsive slider” . The posts I have set up for the slide show are only featured images specifically for this slider. I have set them up so that they are not listed on my blog page, and they are not showing up in my blog feed.

    However in google reader, it is showing all the slides? Is there a way to block this from happening? a setting to remove the “slider” category completely from my feed?

    #9626

    Chris Cree
    Participant
    Post count: 147

    To remove a category from your RSS feed, you can add something along these lines to your functions.php file.

    [php]add_filter( ‘pre_get_posts’, ‘sc_remove_feed_cat’ );
    function sc_remove_feed_cat( $query ) {
    if ( $query->is_feed ) {
    $query->set( ‘cat’ , ‘-10′ );
    }
    return $query;
    }[/php]

    Change out the “10” in ‘-10′ with the category ID for your featured images posts. But be sure to keep the minus sign in there so that it removes the category.


    #9717

    davidh55
    Participant
    Post count: 3

    thanks for the suggestion here, unfortunately I couldn’t get that code to work with the latest version of WordPress. It appears to work, but when I change category IDs nothing happens to the rss feed.

    I’ve found some other code, slightly amended that seems to work, so implemented on my site.

    [php]
    /** Remove category from feed and blog page */
    function dtwd_exclude_category($query) {
    if ( $query->is_feed || $query->is_home ) {
    $query->set(‘category__not_in’, ’13’ );
    }
    return $query;
    }
    add_filter(‘pre_get_posts’, ‘dtwd_exclude_category’);

    [/php]

    Do you think this code is ok? It seems to work

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.