• Resolved Rohaq

    (@rohaq)


    I want my frontpage to display only posts from my ‘Blog’ category, and to list posts from other categories on another page. I’ve tried using the in_category(‘x’) check in the while loop for my theme, but it doesn’t seem to be able to tell the difference between the posts.

    Edited code is as follows:
    [code]<?php while (have_posts() && in_category('4') ) : the_post(); ?>[/code]

    Shows all of my posts, regardless of category, if set to ‘4’, shows nothing if set to anything else ??

    Can anybody suggest as to how I can fix this?

Viewing 5 replies - 1 through 5 (of 5 total)
  • There are some plugins that would help simplify doing what you’re after.

    For instance, have a look at Advanced Category Excluder.

    Thread Starter Rohaq

    (@rohaq)

    That seems to work pretty well, thanks!

    Second problem then: I need to list posts that fall under a particular category on a page. Is there a plugin that’ll do this?

    Thread Starter Rohaq

    (@rohaq)

    Ah, found a plugin that does exactly what I wanted

    PostLists

    Consider this resolved, thanks for your help!

    Not sure about that plugin, but Category pages are a built-in feature of WordPress (and Category_Templates are nifty too)

    Regardless, glad to hear you got it all sorted. Happy blogging!

    Thread Starter Rohaq

    (@rohaq)

    I know what you mean, but it wasn’t quite what I was looking for in terms of navigation and design; I wanted to use categories to create different ‘post areas’ on the site, and then split these areas with actual editable pages, rather than a generic ‘Categories’ list, and without using customised themes for each page.

    Solved now, anyway ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Show only posts from one category?’ is closed to new replies.