Tagged: child theme, template
Hi enfold-team,
Hi everyone,
for child-theme development purposes I often use this code-snippet in my functions.php to detect which template file is actually used.
add_action('wp_head', 'phx_show_template');
function phx_show_template() {
global $template;
var_dump($template);
}
Unfortunately the template variable is either NULL or empty. I would appreciate any idea why that’s the case or any suggestion to display the used template file on a different way.
Many thanks
Rob
Hi 5plus5!
Thank you for using the theme. I hope you’re doing well today. I’ll ask Dude to explain it to you. AFAIK the theme is not using page templates to build a page. It relies on shortcodes. The page is generated using the “template-builder.php” file if you’re using the Advance Layout Builder.
Cheers!
Ismael
Hey!
Yes exactly. Enfold doesn’t use page templates to build the layout but it just inserts shortcodes into the content which then embed the shortcode output (you can find the shortcode files in wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/). The template file ( wp-content/themes/enfold/template-builder.php ) is just a wrapper which queries the shortcode/template builder content and outputs it.
Best regards,
Peter