I wrote a WordPress theme, I want to let it compatible with Elementor, where can I start my work?
2
To make your theme compatible with the Elementor page builder plugin, you need to take care of few things.
There are few things to consider before making a theme compatible with Elementor:
First you need to register location in functions.php Locations are organized in groups:Header, Footer, Single, Archive. To register all location:
function theme_prefix_register_elementor_locations( $elementor_theme_manager ) { $elementor_theme_manager->register_all_core_location(); } add_action( 'elementor/theme/register_locations', 'theme_prefix_register_elementor_locations' );
Second, Display locations in the Theme: We use elementor_theme_do_location() Example, displaying Archive location:
elementor_theme_do_location()
<?php get_header(); // Elementor `archive` location if ( ! function_exists( 'elementor_theme_do_location' ) || ! elementor_theme_do_location( 'archive' ) ) { get_template_part( 'template-parts/archive' ); } get_footer();
Then, make sure to remove container if using elemntor template:
<?php if( !is_page_template('elementor_header_footer')) ){ ?> <div class="container"> <?php } ?>
Remember always to use conditionnal tags to test in case elementor is not installed, otherwise it will throw errors. More detail: Elementor Theme location API
Click here to cancel reply.
2
Answers
To make your theme compatible with the Elementor page builder plugin, you need to take care of few things.
There are few things to consider before making a theme compatible with Elementor:
First you need to register location in functions.php
Locations are organized in groups:Header, Footer, Single, Archive.
To register all location:
Second, Display locations in the Theme: We use
elementor_theme_do_location()
Example, displaying Archive location:
Then, make sure to remove container if using elemntor template:
Remember always to use conditionnal tags to test in case elementor is not installed, otherwise it will throw errors.
More detail: Elementor Theme location API