• I created custom template using Gutenberg editor. I gave it a name and saved it. It shows up in WP among other templates as expected.

    I need to load this template using include_template filter depending of value in custom query variable ( want to create and use archive template for specific combination of Category and custom Taxonomy).

    Procedure requires me to specify template php file name. But, custom template I created is nowhere to be found as a file. It seems like it is saved in database or so.

    How can I use it in include_template filter?

    • This topic was modified 1 year, 3 months ago by pedjas.
Viewing 1 replies (of 1 total)
  • Thread Starter pedjas

    (@pedjas)

    I decided to abandon idea of using template created in editor. I removed it and creates template in theme folder by copying achive.html template to archive-customtaxonomyname.html (I found out that Gutenberg templates are html not php).

    Again, template showed up in Templates editor, but I was unable to load it using include_template filter.

    By examining code of locate_template() I realized that it does not load Gutenberg templates. It seems to work only with old style templates.

    Is there other way to programmatically change template that is to be loaded for selected web page?

Viewing 1 replies (of 1 total)
  • The topic ‘Where is custom template saved? How to use it in include_template filter?’ is closed to new replies.