Forums

List Categories and Most Recent Post from Each (2 posts)

  1. Hebbylaya
    Member
    Posted 2 years ago #

    Hi, first I apologize if this is the wrong section to be posting this in.

    I am looking for a way to list all the categories of a Parent category, and have the most recent post displayed from each category. So say I have my Parent category.php set up like this:

    Parent Category
    - Child Category 1: Most Recent Post in Child Category 1
    - Child Category 2: Most Recent Post in Child Category 2
    etc...

    Then if more Child categories are added, it would automatically be added to the list. I know how to list the categories, but not how to add the most recent post from each category. Is there a simple way of doing this that I am just not finding? Or should I look for a plugin?
    I would be very appreciative of anyone that could send me in the right direction, thanks.

    The reason I am doing this is because I am using the Yet Another Photoblog Plugin, which is working quite well for me, but I have yet to find a way to produce "albums" with it. My solution I had in mind was to just create albums using child categories. So when you click on "Pictures" the category.php for the parent category "Pictures" will list each child category (or album name in this case) with the most recent photo from the album. Perhaps I'm over thinking it, but I could use any others input!

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    I think you'd need a combination of a custom category template and wp_list_categories with the child_of parameter.

    http://codex.wordpress.org/Category_Templates
    http://codex.wordpress.org/Template_Tags/wp_list_categories#Only_Show_Children_of_a_Category

Topic Closed

This topic has been closed to new replies.

About this Topic