Search correction | WordPress.org

[ad_1]

Hello,

In order to correct the search, i’ve just added “return $template;” at the end of function wptm_template_chooser.

There were no else statement what caused a blank page.
The corrected function is :

function wptm_template_chooser( $template ) {
// Post ID
$post_id = get_the_ID();

// For all other CPT
if ( get_post_type( $post_id ) != 'team_manager' ) {
return $template;
}

//Use team_manager template
if ( is_singular('team_manager') ) {
return wptm_get_template_hierarchy( 'single-team_manager' );
}
return $template;
}

Thanks

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer