WordPress.org

Ready to get started?Download WordPress

Forums

Exclude Category From RSS - Suggestions Invited (6 posts)

  1. Vulturo
    Member
    Posted 8 years ago #

    Hi,

    I plan to add a new category for my blog called 'Journal', where I plan to write about the day-to-day boring things which happen to me, apart from the usual 'high-brow' & funstuff content of my blog which is almost all non-personal.

    I've got a decent amount of readers, and I doubt most of them would like to read about what happens with my personal life (because it is so boring!), but I would still like to write about and record it on my blog, but give them an option to ignore it.

    I'm quite clear on how I'm going to do it:
    1. I shall use this plugin (exact opposite of sticky post) to manually ensure that the posts in the 'Journal' category aren't visible on the main page (Of course, I could edit the loop to exclude the category, that would be an alternative solution).
    2. I shall create a new top-level page, which will appear in the menu, and redirectify it to category/journal. Thus people would have to click the journal page link to view the posts in the journal category (I might have a special category-archive page, which lists full posts - not excerpts), but wouldn't be able to view them on the main page

    My only worry is, I want the 'journal' posts not appearing in my regular RSS feeds (all of them) - Is there a plugin which allows you to exclude certain categories from your RSS Feeds.

    If there is, then that is all I need. Please do tell me if there exists such a plugin.

    If there isn't I would appreciate ideas on how to implement this.

  2. ifelse
    Member
    Posted 8 years ago #

    Easiest solution to all your problems:
    1. get the category id of the journal directory e.g 5
    2. open up the index.php in your root.
    3. add the line $cat=-5 (where 5=your category id) underneath
    require('./wp-blog-header.php');

    This will exclude the posts both from the front page and the RSS feed.

    Downside? The journal posts must only belong to this category (so, for example, you can't file a post that you want to exclude under journal and code)

  3. Vulturo
    Member
    Posted 8 years ago #

    Like this??:

    <?php
    /* Short and sweet */
    define('WP_USE_THEMES', true);
    require('./wp-blog-header.php');
    $cat=-5;
    ?>

    Apart from this, how easy, or difficult would it be to write a plugin which excludes certain categories from feeds. For example, folks over at the K2 Forum had been discussing this (A solution for having different feeds for posts and asides)

    It would be nice if there can be such a plugin.

  4. Berko
    Member
    Posted 8 years ago #

    Will that also keep the posts out of the previous/next post navigation when viewing individual posts?

  5. rk
    Member
    Posted 8 years ago #

    You could look this :
    http://wordpress.org/support/topic/39698?replies=7
    No plugin; And one time solution as it works on root index.php ! Category removed from both front page and feed. Worked for me :) [did not see check the feed though but it should work!]

  6. papercuts3
    Member
    Posted 8 years ago #

    I tried this too and it works fine. there is however still something that bugs me.

    In the loop where at the top you can see previous and next posts, the invisible post names are still there. When a person who has not logged in clicks the link you get the 404 Error (which is normal). But it's a pain in the neck to browse. You have to then go back and try to find the next post in order that you can view. One can go through the archives but what if the readers of the post aren't so smart about it. I think this is something that upsets the smoothness of a blog.

    Anyone has any solution for this? Private posts can be blocked out in the archive pages, why not in the individual pages?

Topic Closed

This topic has been closed to new replies.

About this Topic