[Resolved] How to override generate-sections-page-template.php in theme?

Home Forums Support [Resolved] How to override generate-sections-page-template.php in theme?

Home Forums Support How to override generate-sections-page-template.php in theme?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #144083
    madpiotr

    I hope it is possible to override this template.

    #144139
    bdbrown

    Hi madpiotr. There isn’t really a clean way to override a file in a plugin. What is it you’re wanting to change? If you’re doing anything other than minor changes it may break the Sections functionality. If you’re just wanting to add a bit of code then using a hook in the GP Hooks Add-on might be the way to go.

    #144142
    Tom
    Lead Developer
    Lead Developer

    If you really wanted to, you could do something like this: https://gist.github.com/generatepress/84bae0e5ac0d94ce46f7

    Then it would be looking for your template in your child theme called generate-sections-page-template.php.

    As @bdbrown said, be careful changing stuff around as it could break the functionality of the plugin.

    #144197
    madpiotr

    bdbrown gp-hooks would work form me but not in all cases. I wish to keep all my custom stuff in child theme

    Tom, your solution works as a charm
    I THANK YOU both.

    I love to work with generatepress. Great work!

    #144306
    Tom
    Lead Developer
    Lead Developer

    Awesome, glad that worked 🙂

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