﻿{"id":117,"date":"2026-02-26T13:32:19","date_gmt":"2026-02-26T12:32:19","guid":{"rendered":"https:\/\/baqueiro.es\/store\/?post_type=bdw_plugin_doc&#038;p=117"},"modified":"2026-03-05T14:24:53","modified_gmt":"2026-03-05T13:24:53","slug":"b-easy-head-footer-for-elementor","status":"publish","type":"bdw_plugin_doc","link":"https:\/\/baqueiro.es\/store\/plugin-docs\/b-easy-head-footer-for-elementor\/","title":{"rendered":"[B] Easy Head &#038; Footer for Elementor"},"content":{"rendered":"\n<h2>Requirements<\/h2>\n<ul>\n<li>WordPress 5.8 or higher<\/li>\n<li>PHP 8.1 or higher<\/li>\n<li>Elementor (free version) installed and active<\/li>\n<\/ul><br>\n\n<h2>Installation<\/h2>\n<ol>\n<li>Go to <strong>Plugins \u2192 Add New<\/strong> in your WordPress admin.<\/li>\n<li>Click <strong>Upload Plugin<\/strong> and select the <code>.zip<\/code> file, or search for &#8220;Easy Head &amp; Footer for Elementor&#8221;.<\/li>\n<li>Click <strong>Install Now<\/strong>, then <strong>Activate<\/strong>.<\/li>\n<li>A new menu item <strong>Templates H\/F<\/strong> will appear in the admin sidebar.<\/li>\n<\/ol><br>\n\n<h2>Creating a Header Template<\/h2>\n<ol>\n<li>Go to <strong>Templates H\/F \u2192 Add New<\/strong>.<\/li>\n<li>Enter a title, for example <em>&#8220;Main Header&#8221;<\/em>.<\/li>\n<li>Click <strong>Edit with Elementor<\/strong>.<\/li>\n<li>Design your header using any Elementor widgets \u2014 navigation menus, logos, buttons, icons, etc.<\/li>\n<li>Click <strong>Publish<\/strong> (or Update) when done.<\/li>\n<\/ol><br>\n\n<h2>Creating a Footer Template<\/h2>\n<ol>\n<li>Go to <strong>Templates H\/F \u2192 Add New<\/strong>.<\/li>\n<li>Enter a title, for example <em>&#8220;Main Footer&#8221;<\/em>.<\/li>\n<li>Click <strong>Edit with Elementor<\/strong>.<\/li>\n<li>Design your footer \u2014 copyright text, social links, contact info, columns, etc.<\/li>\n<li>Click <strong>Publish<\/strong> (or Update) when done.<\/li>\n<\/ol><br>\n\n<h2>Settings<\/h2>\n<p>Navigate to <strong>Settings \u2192 Easy Header\/Footer<\/strong> to configure the plugin.<\/p>\n<ul>\n<li><strong>Header Template<\/strong> \u2014 select the template to use as your site header. It will be injected right after the <code>&lt;body&gt;<\/code> tag via the <code>wp_body_open<\/code> hook.<\/li>\n<li><strong>Footer Template<\/strong> \u2014 select the template to use as your site footer. It will be injected via the <code>wp_footer<\/code> hook.<\/li>\n<li><strong>Hide Theme Header<\/strong> \u2014 check this to inject CSS that hides your theme&#8217;s native header. Useful to prevent duplicate headers.<\/li>\n<li><strong>Hide Theme Footer<\/strong> \u2014 check this to inject CSS that hides your theme&#8217;s native footer.<\/li>\n<li><strong>Custom Hide Selectors<\/strong> \u2014 one CSS selector per line. The plugin ships with common defaults (<code>.site-header<\/code>, <code>header#header<\/code>, <code>.site-footer<\/code>, <code>footer#footer<\/code>, etc.). Adjust these to match your theme if needed.<\/li>\n<\/ul><br>\n\n<h2>Display Conditions (Optional)<\/h2>\n<p>By default, the header and footer are applied to every page on your site. If you need more control:<\/p>\n<ul>\n<li><strong>Enable Conditions<\/strong> \u2014 check this to activate the rules below.<\/li>\n<li><strong>Include by Post Types<\/strong> \u2014 select one or more post types. The header\/footer will only appear on singular pages of these types. Leave empty to not restrict by post type.<\/li>\n<li><strong>Exclude by Post Types<\/strong> \u2014 select post types to exclude. Overrides the include rule.<\/li>\n<li><strong>Include by URL<\/strong> \u2014 one pattern per line. The current URL must match at least one pattern. Use <code>\/regex\/<\/code> syntax for regular expressions, or plain text for case-insensitive substring matching.<\/li>\n<li><strong>Exclude by URL<\/strong> \u2014 one pattern per line. If the current URL matches any pattern here, the header\/footer will not be displayed. Same syntax as include.<\/li>\n<\/ul><br>\n\n<h2>Using Elementor Library Templates<\/h2>\n<p>In addition to the dedicated <strong>Templates H\/F<\/strong> CPT, the plugin also lists templates from the <strong>Elementor Library<\/strong> (<code>elementor_library<\/code>) in the settings dropdown. This means you can reuse any saved Elementor template as a header or footer.<\/p><br>\n\n<h2>How It Works (Technical)<\/h2>\n<h2>Rendering<\/h2>\n<ul>\n<li>The header is rendered via the <code>wp_body_open<\/code> action hook, wrapped in a <code>&lt;div id=\"bdw-ehfe-header\"&gt;<\/code> with <code>role=\"banner\"<\/code>.<\/li>\n<li>The footer is rendered via the <code>wp_footer<\/code> action hook, wrapped in a <code>&lt;div id=\"bdw-ehfe-footer\"&gt;<\/code> with <code>role=\"contentinfo\"<\/code>.<\/li>\n<li>Elementor&#8217;s <code>get_builder_content_for_display()<\/code> is used to render the template with full widget support.<\/li>\n<\/ul><br>\n\n<h2>Styling &amp; Assets<\/h2>\n<ul>\n<li>Each template&#8217;s CSS is generated and enqueued in the <code>&lt;head&gt;<\/code> via Elementor&#8217;s Post CSS API \u2014 no inline styles.<\/li>\n<li>The plugin adds <code>elementor-default<\/code> and <code>elementor-kit-{ID}<\/code> body classes so that global Kit styles (colors, fonts, spacing) are applied correctly.<\/li>\n<li>If Elementor&#8217;s frontend styles\/scripts are not yet enqueued on a page, the plugin enqueues them automatically.<\/li>\n<\/ul><br>\n\n<h2>Editor Safety<\/h2>\n<p>The plugin detects when you are inside the Elementor editor or preview iframe and automatically suppresses header\/footer injection. This prevents layout conflicts while you are editing templates.<\/p>\n\n<h2>SEO Protection<\/h2>\n<p>Template CPT pages (<code>bdw_ehfe_template<\/code>) are automatically marked with <code>noindex, nofollow<\/code> using both a <code>&lt;meta&gt;<\/code> tag and an <code>X-Robots-Tag<\/code> HTTP header. This ensures search engines do not index these internal template pages.<\/p><br>\n\n<h2>Troubleshooting<\/h2>\n\n<h2>Header is not showing<\/h2>\n<p>Your theme must call <code>wp_body_open()<\/code> immediately after the <code>&lt;body&gt;<\/code> tag. Most themes released since 2020 include this hook. If yours does not, add the following line to your theme&#8217;s <code>header.php<\/code> file, right after the opening <code>&lt;body&gt;<\/code> tag:<\/p>\n<p><code>&lt;?php do_action( 'wp_body_open' ); ?&gt;<\/code><\/p><br>\n\n<h2>Duplicate header or footer<\/h2>\n<p>This happens when the theme&#8217;s native header\/footer is still visible alongside the plugin&#8217;s custom templates. To fix it:<\/p>\n<ol>\n<li>Go to <strong>Settings \u2192 Easy Header\/Footer<\/strong>.<\/li>\n<li>Check <strong>Hide Theme Header<\/strong> and\/or <strong>Hide Theme Footer<\/strong>.<\/li>\n<li>If the defaults don&#8217;t work, inspect your theme&#8217;s header\/footer element in the browser (right-click \u2192 Inspect) and find the CSS selector (e.g., <code>header.main-header<\/code>).<\/li>\n<li>Add that selector to the <strong>Custom Hide Selectors<\/strong> field.<\/li>\n<\/ol><br>\n\n<h2>Elementor Kit styles not applying<\/h2>\n<p>Make sure your Elementor Global Settings (Site Settings) are saved. The plugin reads the active Kit ID to inject the correct body class. If you recently changed your Kit, save it again and clear any page cache.<\/p>\n\n<h2>Header\/footer appearing inside the Elementor editor<\/h2>\n<p>This should not happen \u2014 the plugin automatically detects editor and preview modes. If it does occur, clear your browser cache and any server-side cache, then try again.<\/p><br>\n\n<h2>Hooks Reference<\/h2>\n<p>The following WordPress hooks are used by the plugin:<\/p>\n<ul>\n<li><code>wp_body_open<\/code> \u2014 outputs the header template.<\/li>\n<li><code>wp_footer<\/code> \u2014 outputs the footer template.<\/li>\n<li><code>wp_head<\/code> \u2014 prints the CSS rules that hide the theme&#8217;s header\/footer.<\/li>\n<li><code>wp_enqueue_scripts<\/code> \u2014 enqueues each template&#8217;s generated CSS file and Elementor base assets.<\/li>\n<li><code>body_class<\/code> \u2014 adds Elementor Kit body classes (<code>elementor-default<\/code>, <code>elementor-kit-{ID}<\/code>).<\/li>\n<li><code>elementor\/cpt_support<\/code> \u2014 registers the template CPT with Elementor&#8217;s editor.<\/li>\n<li><code>send_headers<\/code> \u2014 sends <code>X-Robots-Tag: noindex<\/code> on template CPT pages.<\/li>\n<\/ul><br>\n\n<h2>Privacy &amp; Data<\/h2>\n<p>This plugin:<\/p>\n<ul>\n<li>Stores only one row in <code>wp_options<\/code> (<code>bdw_ehfe_settings<\/code>).<\/li>\n<li>Does <strong>not<\/strong> set any cookies.<\/li>\n<li>Does <strong>not<\/strong> make any external HTTP requests.<\/li>\n<li>Does <strong>not<\/strong> collect any user data.<\/li>\n<li>Is fully compatible with GDPR, LGPD, and similar privacy regulations.<\/li>\n<\/ul><br>\n\n<h2>Uninstallation<\/h2>\n<p>Deactivating the plugin stops the header\/footer from being rendered, but your templates remain in the database as CPT posts. To fully remove:<\/p>\n<ol>\n<li>Deactivate the plugin.<\/li>\n<li>Delete it from <strong>Plugins \u2192 Installed Plugins<\/strong>.<\/li>\n<li>Optionally, delete the <strong>Templates H\/F<\/strong> posts manually if you no longer need them.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Requirements WordPress 5.8 or higher PHP 8.1 or higher Elementor (free version) installed and active Installation Go to Plugins \u2192 Add New in your WordPress admin. Click Upload Plugin and select the .zip file, or search for &#8220;Easy Head &amp; Footer for Elementor&#8221;. Click Install Now, then Activate. A new menu item Templates H\/F will [&hellip;]<\/p>\n","protected":false},"featured_media":0,"template":"","class_list":["post-117","bdw_plugin_doc","type-bdw_plugin_doc","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/baqueiro.es\/store\/wp-json\/wp\/v2\/bdw_plugin_doc\/117","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/baqueiro.es\/store\/wp-json\/wp\/v2\/bdw_plugin_doc"}],"about":[{"href":"https:\/\/baqueiro.es\/store\/wp-json\/wp\/v2\/types\/bdw_plugin_doc"}],"version-history":[{"count":10,"href":"https:\/\/baqueiro.es\/store\/wp-json\/wp\/v2\/bdw_plugin_doc\/117\/revisions"}],"predecessor-version":[{"id":295,"href":"https:\/\/baqueiro.es\/store\/wp-json\/wp\/v2\/bdw_plugin_doc\/117\/revisions\/295"}],"wp:attachment":[{"href":"https:\/\/baqueiro.es\/store\/wp-json\/wp\/v2\/media?parent=117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}