Can anyone tell me how I can use the add_filter function to chance the plugin_dir_path of a page?
When I use get_post_type() to set a temple for my movie_reviews there is no problem
But I dont know how to use the function on a none register_post_type.
I like to use a custom page on the url http://www.domain.com/user_profile
and in a form action action=”search_result”
But I don’t know how this works on a none register_post_type
add_filter( 'template_include','include_template_function', 1 );
function include_template_function( $template_path ) {
if ( get_post_type() == 'movie_reviews' ) {
$template_path = plugin_dir_path( __FILE__ ) .'/single-movie_reviews.php';
}
if ( ....... == 'search_sesult' ) {
$template_path = plugin_dir_path( __FILE__ ) .'/movie-searchresult_reviews.php';
}
if ( ....... == 'user_profile' ) {
$template_path = plugin_dir_path( __FILE__ ) .'/user_profile.php';
}
return $template_path;
}
You can use Conditional Tags for this.
For example: