Last active
February 21, 2018 18:24
-
-
Save pingram3541/f77885bfde845d738d51b5aad0c5c553 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 = WP_PLUGIN_DIR . '/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
Updated to use dynamic plugin path vs hard coded