WordPress.org

Ready to get started?Download WordPress

Forums

Customize calendar archive... (2 posts)

  1. checog0
    Member
    Posted 1 year ago #

    I have setting up a newspaper site and use the calendar widget, actually if I select a date from the calendar widget display all post of the select day, I want to display the select day post but group by category ej:

    Category 1
    Post 1
    Post 2

    Category 2
    Post 1
    post 2.... etc..

    any idea??

  2. bcworkz
    Member
    Posted 1 year ago #

    The specifics are theme dependent, but the calendar widget simply opens a daily archive. The way the output is managed is with the archive.php template. This would affect all archive output though, you could use is_day() if this arrangement should only be for daily archives.

    It's also possible to extend the widget so it links to a completely custom template only for calendar listings, leaving all other archives as they are.

    Regardless, you would need the template to either: 1) Alter the query to groupby category, and the loop detects a change in category to know when to output a new category sub-header.

    or 2) Loop through each category and query for that day and category each time. So if you had 5 categories, you would do 5 different queries.

Topic Closed

This topic has been closed to new replies.

About this Topic