WordPress.org

Support

Support » Themes and Templates » How can I display only one post from each category?

How can I display only one post from each category?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Without writing the code here, what I would do is use get categories to return all the categories that have posts in an array. Then I would use WP_Query and iterate through all the categories in the array for the recent post in that category.

    Thank you David! Unfortunately my coding knowledge is quite limited, and I have no idea how to use the advice you just gave. Could you help me implement it in the code I use to put the posts on the first page?

    This code: http://pastebin.com/pSDY5x32

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How can I display only one post from each category?’ is closed to new replies.
Skip to toolbar