Virtual Page + template
-
I have defined a child theme bases on twenty twenty-three with the aim of defining a bunch of dynamic virtual pages ( adding some add_rewrite_rule at init, some query_var and trapping an add_filter(‘template_include’ …?) )
in this ‘template_include’ filter, I load my own PHP template as I did pre WP 6.3
?
I succeed in loading the “template” I have designed in WP, and everything is correctly process ( shortcodes, header and footer blocks ) but it lacks the “top” of the file ( <html><head>…<body> and thus the formatting… )
I do this in my virtual template page :$modelTemplate = get_post( 766 ); // id of the template $content = apply_filters( 'the_content', $modelTemplate->post_content ); echo $content;
What is a correct way to do it now ?
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Virtual Page + template’ is closed to new replies.