• Hi,

    Everything is going great with WP so far but I have 1 problem. I want 2 columns, the first to be all one category, which I’ve done. The second column should be the 8 most recent articles from 2 categories.

    Col 1 = Cat1 (done)
    Col 2 = Cat2,Cat3 (8 most recent)

    I’ve been looking at get_posts() but I’m not sure if this can be done with multiple categories?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Ziyphr

    (@ziyphr)

    Maybe I’m not being clear enough I’d like a single merged list of 8 items from 2 specific categories, ordered by date.

    I’m sure others must have attempted such a thing before.

    Before you get into get posts you need to consult the Codex on multiple loops.

    Thread Starter Ziyphr

    (@ziyphr)

    I think it was actually more simple than I expected. Turns out you only need to use

    query_posts('showposts=8&cat=2,3');

    What got me was that you should only write ‘cat’, not ‘category’, which is what get_posts() used.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Posts from certain categories’ is closed to new replies.