[Resolved] Page template not showing and old were removed

Home Forums Support [Resolved] Page template not showing and old were removed

Home Forums Support Page template not showing and old were removed

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #384342
    Amit

    After updating to the latest version, old page templates were automatically removed and now when I am trying to add my new page template, it’s not showing up. What to do?
    If I am using hook, the ad code is getting inserted to each page which is not desired.

    #384401
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    How were you adding the page templates? If you’re adding custom page templates, they should go into your child theme – that way, updating the theme won’t affect them.

    #384419
    Amit

    I’ve added the templates into wp-content/themes/generatepress/custom-template.php and it has worked before. I’ve even added a template called sitemap.php and it’s working fine but newer templates are not showing and I am really fizzled as why?

    #384723
    Tom
    Lead Developer
    Lead Developer

    Custom files should always be added to a child theme: https://docs.generatepress.com/article/using-child-theme/

    Any changes inside the parent theme folder are removed when the theme is updated.

    #385023
    Amit

    Thanks Tom, now it works. I’ve even added a custom code to single.php and uploaded it to child theme. That too works now seamlessly.

    #385049
    Tom
    Lead Developer
    Lead Developer

    Awesome 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.