Created
December 16, 2020 15:51
-
-
Save Frisoni/507712bb8cb8c575f70b625140be458f to your computer and use it in GitHub Desktop.
Change default template from post to page in Flatsome
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Change default template from post to page in Flatsome | |
add_filter( 'template_include',function ( $template ) { | |
// CPTs | |
$cpts = array( 'cpt_name'); | |
if ( is_singular( $cpts ) ) { | |
// change the default-page-template.php to your template name | |
$default_template = locate_template( array( 'page.php' ) ); | |
if ( '' != $default_template ) { | |
return $default_template ; | |
} | |
} | |
return $template; | |
}, 99 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment