in my main plugin page i check if a certain page is visited if so, i load a certain template. in the following way:
add_filter( 'template_include', array($this, 'includeTemplate'), 99 );
public function includeTemplate($template){
global $wp_query;
if(is_page() && $wp_query->query['pagename'] == 'my_page_name'){
include(plugin_dir_path( __FILE__ ).'templates/my_page_name.php');
die;
}
return $template;
}
my question is how can i load all the queue scripts and styles to this template without using the_header()
I've tried :
global $wp_scripts;
foreach( $wp_scripts->queue as $handle ) :
echo $handle . ' | ';
endforeach;
The above echoed admin-bar
Thanks.