WordPress.org

Forums

[resolved] Can posts from only one category be shown on front page? (9 posts)

  1. mimimimi
    Member
    Posted 8 years ago #

    Hi,

    I have a blog at http://www.worldofmonkey.com/monkey_blog and I am hoping to have the main blog show on that page, but also to have a separate category 'Ask Monkey'. I have set this up and tried to make a post to appear in this new Ask Monkey category, but not in the main body of the blog. I tried to set the front page to display not the latest posts but the 'Monkey's Blog' page, but this doesn't work - the option is only to display one of the created pages 'how to use this blog' etc.

    So - is there a way of making a category with the option to make posts in that category not appear on the front page?

    Thanks. Mimi :o)

  2. saphod
    Member
    Posted 8 years ago #

    Hi Mimi,

    you can use the query_posts tag to define which posts are shown by The Loop. If you want to exclude posts of a special category from the main blog, you can put a

    query_posts('cat=-cat_id')

    before

    <?php while (have_posts()) : the_post(); ?>.

    In addition to this, you could create a page called "Monkey Blog" that has a slightly changed Main Index Template which only shows the posts from the "Ask Monkey" category using query_posts and the loop.

    If you do not want the category to appear in e.g. the sidebar, you should exclude it with wp_list_categories().

    See this post on wordpress.org where I had a similar question.

  3. Jeremy Clark
    Moderator
    Posted 8 years ago #

    Yes there is have a look here. All you need to do is edit your main index template with these instructions.

  4. mimimimi
    Member
    Posted 8 years ago #

    Thankyou very much Jeremyclark13 :o)

  5. mimimimi
    Member
    Posted 8 years ago #

    Oh, thanks saphod - I hadn't seen your reply as well :o)

  6. mimimimi
    Member
    Posted 8 years ago #

    Sorry for being a bit pants - but I have spent HOURS trying to work this out (I am sorry guys and girls - I am not very good with this sort of thing)

    Now - I know this might seem stupid - but am I editing the MAIN index.php template here, or the used theme's index.php template.

    As far as I can see the main one is very sparse - just a couple of lines - the theme one is busier, but I can't find the area that I am supposed to be editing...

    Maybe it is too complex for me? I have tried many things, but can't get it working - I did get it to not display the 'Ask Monkey' posts, but then it was displaying the other posts over and over and over...

    Any idea what I am doing wrong here?

    Sorry again for being a pain :o(

    Mimi

  7. Chris_K
    Member
    Posted 8 years ago #

    You would, of course, only ever edit THEME files.

    Have you considered Plugins?

    Category Visibility plugin.
    Ultimate Category Excluder plugin

  8. mimimimi
    Member
    Posted 8 years ago #

    yes - I thought as much - but you know, I just couldn't get it to work with the theme template I was working with.

    No _ I had looked through the plug-ins, but not found anything suitable - this looks just the ticket - thankyou

    M :o)

  9. mimimimi
    Member
    Posted 8 years ago #

    Just a quick update to anyone who later might read this:

    the 'Ultimate Category Excluder' did not work for me - it DID take the undesired posts of of the front page, but it also added every post from every category to every other archive. I'm using 2.1 and it isn't working for me at all.

    However - the 'Category visibility' plug-in seems to work perfectly.

    Thanks to everyone for your help

    M :o)

Topic Closed

This topic has been closed to new replies.

About this Topic