Change (or customize) X Theme / Cornerstone Default Template

Is there any way to change the X Theme / Cornerstone Default page template to be blank container, no header and no footer? I’d prefer that to be the default instead of having to change it on any given page, and I am having trouble figuring out how to customize the Default Template file for X Theme (basically I want the default template to load absolutely nothing in terms of header/footer/container, and everything to be managed within all Cornerstone sections). Browsed around the \x\framework\views\integrity directory (we have Integrity selected) but had no luck in identifying which file to edit to change the default page template for X theme.

Thanks for any feedback!

Hi @cfdigadmin,

While that is outside the scope of support, I could point you in the right direction with the understanding that it would ultimately be your responsibility to take it from here.

Please check this thread: https://wordpress.stackexchange.com/questions/196289/is-there-a-way-to-change-the-default-page-template-selection. Then implement the code to your child theme’s functions.php file.

Example,

function wpse196289_default_page_template() {
    global $post;
    if ( 'page' == $post->post_type 
        && 0 != count( get_page_templates( $post ) ) 
        && get_option( 'page_for_posts' ) != $post->ID // Not the page for listing posts
        && '' == $post->page_template // Only when page_template is not set
    ) {
        $post->page_template = "template-blank-4.php";
    }
}
add_action('add_meta_boxes', 'wpse196289_default_page_template', 1);

This may only work on newly created pages, hence, if you wish to force it for all existing pages. Then implement this code instead of that code

add_filter( 'template_include', 'default_page_template', 99 );

function default_page_template( $template ) {

    if ( is_singular( 'page' )  ) {
        $default_template = locate_template( array( 'template-blank-4.php' ) );
        if ( '' != $default_template ) {
            return $default_template ;
        }
    }

    return $template;
}

You can utilize the Blank - No Container | No Header, No Footer page template instead. That is an absolute blank template.

Cheers!

Thanks for your reply! That’s a nifty and helpful solution so thank you for posting.

It appears I also could achieve what I was looking to change by customizing the file:
x/framework/views/integrity/wp-page.php

We basically want the default to always be blank no container / no header / no footer.

Thank you!

We are delighted to assist you with this.

Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.