This is a great question, and it’s complicated because we are using what WordPress refers to as an “archive page”. When I view the page using Query Monitor on a vanilla WP installation, I see this:
Template File
page.php
Template Hierarchy
archive-bp_doc.php
archive.php
index.php
which means that after looking through the theme for the most appropriate template file to use, WP is choosing page.php
from my theme, TwentyNineteen.
Changing that wrapper easily depends on if your theme gives you the ability to do it, but most don’t (it’s an unusual need unless you’re building something more complicated than a blog). You can specify which template to use for the edit/create page using a filter like this:
add_filter( 'template_include', 'bp_docs_specify_page_template_for_edit_view', 99 );
function bp_docs_specify_page_template_for_edit_view( $template ) {
if ( bp_docs_is_doc_create() || bp_docs_is_doc_edit() ) {
$new_template = locate_template( array( 'page-special-tmpl.php' ) );
if ( '' != $new_template ) {
$template = $new_template ;
}
}
return $template;
}
where you replace page-special-tmpl.php
with the filename of the template file you wish to use.
-
This reply was modified 2 years, 9 months ago by
David Cavins.
-
This reply was modified 2 years, 9 months ago by
David Cavins.