Created
April 1, 2017 18:28
-
-
Save Tmeister/92f40e1df92633d51e038693b5f4c7a4 to your computer and use it in GitHub Desktop.
You can show *your* page templates in the predesigned templates area with screenshots
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
<?php | |
/** | |
* Elementor get the local templates via a CPT query and use a filter to let us change the template data | |
* https://github.com/pojome/elementor/blob/master/includes/template-library/sources/local.php#L202 | |
* In ouy theme or plugin we can hook that filter as follow | |
* | |
* This filter change the source only for the *page* template type to show it in the main tab | |
* @see https://cl.ly/1z2Y1n2x0K0F | |
**/ | |
function custom_elementor_template_list( $template ) { | |
if ( 'page' === $template['type'] ) { | |
$template['source'] = 'remote'; | |
$template['isPro'] = false; | |
} | |
return $template; | |
} | |
add_filter( 'elementor/template-library/get_template', 'custom_elementor_template_list' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Tmeister is it working for Elementor 3+ versions?
I got a blank section on the pages tab