Display Elementor in Theme
February 13, 2025 · AI Conversations
### Steps to Display Elementor Header/Footer in a Non-Elementor Theme:
#### 1️⃣ **Find the Header/Footer Template ID**
– Go to **Elementor → Templates → Theme Builder**.
– Find the **Header** or **Footer** template.
– Copy the **Template ID** (found in the URL, e.g., `post=123` means the ID is `123`).
#### 2️⃣ **Insert the Header/Footer in Your Theme**
Edit your theme’s `header.php` or `footer.php` file and add:
<?php
echo do_shortcode('[elementor-template id="123"]'); // Replace 123 with your actual template ID
?>
#### 3️⃣ **Use PHP to Load Elementor Header/Footer Globally**
If you want to dynamically load the Elementor header and footer, add this to `header.php`:
<?php
if ( function_exists( 'elementor_theme_do_location' ) ) {
elementor_theme_do_location( 'header' );
} else {
get_template_part( 'template-parts/header' ); // Fallback to default header
}
?>
For `footer.php`, use:
<?php
if ( function_exists( 'elementor_theme_do_location' ) ) {
elementor_theme_do_location( 'footer' );
} else {
get_template_part( 'template-parts/footer' ); // Fallback to default footer
}
?>
### 🔹 Alternative: Use a Plugin
If you don’t want to modify theme files, install **"Insert Headers and Footers"** or **"Anywhere Elementor"** and use the shortcode:
[elementor-template id="123"]
This method ensures Elementor headers and footers work in **any** WordPress theme, even non-Elementor ones. 🚀