[Resolved] Overriding archives.php in child theme

Home Forums Support [Resolved] Overriding archives.php in child theme

Home Forums Support Overriding archives.php in child theme

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2338371
    Zarar

    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?

    #2338384
    David
    Staff
    Customer Support

    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.

    #2339232
    Zarar

    This works, thank you!

    #2339824
    David
    Staff
    Customer Support
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.