• Please feel free to point me in the direction of a better forum for this question. My goal is to have a page on my site that presents a selection of posts in forward chronological order (filtered by a specific category). I want it to work like the main index page, except for showing a subset of posts, and in the opposite order from the usual most recent first.

    I am working with the twentytwentytwo theme, and have created a child theme. In that child theme, I created a copy of index.html and renamed it diary.html. I edited it so that the query uses “order”:”asc” instead of desc. I have a “page” in my site named “Trip Diary” and have set it to use the “diary” template. But when I go to that page, it just shows a date with a link, and that link is to the Trip Diary page so it does nothing.

    Any helpful clues appreciated

    • This topic was modified 2 years, 2 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
Viewing 2 replies - 1 through 2 (of 2 total)
  • In your child theme, you will want copy archive.php from the parent theme and make your customizations to order by asc.

    Then you will need to rename that to have the same slug or ID for your trip diary category in your child theme – so for example, if the category slug is “trip_diary”, you would name the file trip_diary.php in your child theme.

    This explains more about creating custom category archive templates:
    https://codex.www.ads-software.com/Category_Templates

    • This reply was modified 2 years, 2 months ago by mchelles. Reason: typo
    • This reply was modified 2 years, 2 months ago by mchelles.
    Thread Starter tastewar

    (@tastewar)

    Thank you, @mchelles that sounds very promising!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Looking to create a “diary” template in child theme’ is closed to new replies.