Archived topic
Overriding archives.php in child theme
3 replies · Started by Zarar on September 9, 2022
I want a custom archives.php page. I've created a Block Element which displays the posts exactly on how I want them and inherited from the main query. My problem is that I can't seem to override the parent theme's archives.php so I'm left with the posts rendered twice.
I tried duplicating an archives.php in the child theme and deleting the code that renders the posts (e.g., have_posts() block) but that didn't do anything. WordPress seems to have ignored it completely.
Any thoughts on how I would go about this?
Hi there,
you need to use the Block Element - Content Template so this will update the content.php template:
https://docs.generatepress.com/article/block-element-content-template/
In the next update you will be able to unhook the entire loop in the template and replace it with a GB Query Loop.
This works, thank you!
You're welcome