I tried
add_filter( 'page_template', 'single_page_template' );
function single_page_template( $template )
{
if ( is_singular( 'dwqa-question' ) ) {
$template = get_stylesheet_directory() . '/' . page-question.php;
}
return $template;
}
now, if I will out put echo get_page_template();
I am getting
/var/www/html/my-site/wp-content/themes/theme-child/page-question.php
but modifying the page-question.php file not effecting the output ,adding some text to this template like
get_header(); ?>zzzzzzzzz
not getting out put. page.php is assign to single question page using template_include
hook is this because of that , but if yes echoing get_page_template()
should also give page.php tempalte path as output .
Just modified page.php like
get_header(); ?>aaaa
and aaaa
is appearing on page .
How I should override it ?? please let me know if I should provide any other detail ?