Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save norewp/5ce837ccb77ad51313f2184aaf56f101 to your computer and use it in GitHub Desktop.
Save norewp/5ce837ccb77ad51313f2184aaf56f101 to your computer and use it in GitHub Desktop.
Used in theme functions.php - set Elementor Library post type to use built-in Canvas template by default
/* ---------------------------------------------------------------------------
* Force Elementor Library to use Canvas Template
* - this gist file name can also be used in your theme to override the template instead of this
* --------------------------------------------------------------------------- */
function get_elementor_library_post_type_template( $single_template ) {
global $post;
if ($post->post_type == 'elementor_library') {
$single_template = dirname( __FILE__ ) . '/../../plugins/elementor/includes/page-templates/canvas.php';
}
return $single_template;
}
add_filter( 'single_template', 'get_elementor_library_post_type_template' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment