是否可以添加位于wordpress插件文件夹中的页面模板而不是主题文件夹,以便在页面属性中显示?
对于单页和存档,我使用此代码:
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;
但是现在它没有出现在属性中?