Forked from pingram3541/single-elementor_library.php
Created
February 21, 2018 11:05
-
-
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
This file contains hidden or 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
/* --------------------------------------------------------------------------- | |
* 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