Is it possible to add a page template located in a wordpress plugin folder instead of the theme folder so it is showing in the page attributes?
For a single page and archive i am using this code:
if ( get_post_type() == 'register' ) {
if ( is_single() ) {
if ( $theme_file = locate_template( array ( 'single-register.php' ) ) ) {
$template_path = $theme_file;
} else {
$template_path = CONDOREG__PLUGIN_DIR . '/single-register.php';
}
}
if ( is_archive() ) {
if ( $theme_file = locate_template( array ( 'archive-condoleances.php' ) ) ) {
$template_path = $theme_file;
} else {
$template_path = CONDOREG__PLUGIN_DIR . '/archive-condoleances.php';
}
}
}
return $template_path;
But for now it is not showing up in the attributes?