Site logo

Archived topic

Custom archive pages

3 replies · Started by Paul on April 18, 2022

Viewing posts 1–4 of 4

I am just in the process of moving over to GP and picked up the pro version.

I am wanting to create content-archive pages so I can customise them (I prefer doing it this way). Usually, I would just copy an archive template and rename it but can't seem to find one. I have found arhive.php and changed it to get_template_part( 'content', 'archive' );

However, not exactly sure what should be in content-archive.php.

Cheers!

Hi Paul,

By default, there is no content-archive.php file in GeneratePress theme. However, the get_template_part to get the file for archives is more like: https://github.com/tomusborne/generatepress/blob/adfe090929b0515cdf894f4c6b722cfe8c0790dc/inc/theme-functions.php#:~:text=get_template_part(%20%27content%27%2C%20get_post_format()%20)%3B

By default, it uses content.php for category archives if whatever content-get_post_format() returns doesn’t exist: https://github.com/tomusborne/generatepress/blob/master/content.php

Hope this clarifies. :)

Thanks Fernando, makes sense and should be able to get it working.

You’re welcome Paul! Glad to be of assistance! Feel free to reach out anytime you’ll need assistance with anything else. :)

This archived topic is closed to new replies.