WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Setting posts of a category not to show on main page (6 posts)

  1. Red1
    Member
    Posted 6 years ago #

    My site is for automotive news. (www.motoring-news.com)
    I need a section that deals with the release of new models. This requires that the posts for this section are not posted on the main page by default ie. category "Future" does not post to main page.
    I would also like the posts in this category to expire on a future date (I believe there are plugins for this) and when they do expire to be archived into a seperate archive other than the standard monthly archive.

    How much of this is possible? Any help appreciated.

  2. moshu
    Member
    Posted 6 years ago #

    Click Extend on the top of this page > Plugins... and search for exclude category or something like that

  3. Red1
    Member
    Posted 6 years ago #

    Thanks moshu, I'm very new to WP, still finding my way around where to look for things.
    I have noticed that quite a lot of the plugins I've found are now not compatible with 2.3 and are not being updated.

  4. moshu
    Member
    Posted 6 years ago #

    Well, WP 2.3. is relatively new and plugin authors (like everybody else) have their lives... mostly outside of WP :)

    Some plugins might get updated - others will be forgotten as it happened with so many "orphan" plugins.

  5. motocafe
    Member
    Posted 6 years ago #

    This seems to be a common request. Instead of relying on plugin authors, is there some way this feature could be incorporated into WP?

  6. nocturnea
    Member
    Posted 6 years ago #

    you can do it by putting this in your index.php file of your theme:

    before your post content:

    <?php if ( in_category(17) ) {
    echo ' <div style="display: none;">';
    }
    ?>

    after your post content:

    <?php if ( in_category(17) ) {
    echo ' </div>';
    }
    ?>

    replace 17 with the id number of the category you want to exclude.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.