HeadFoot adds a header and footer builder to the free version of Elementor. You build a header or a footer as a normal Elementor template. You then tell the plugin where to show it: on the whole site, on all pages, on one page, on an archive, or for one user role.
The plugin does not add widgets and it does not need Elementor Pro. You work with the widgets that free Elementor ships.
[headfoot_template id="123"] and PHP functions to render a template anywhere.The plugin picks the integration method for the active theme in this order:
add_theme_support( 'headfoot' ) or add_theme_support( 'header-footer-elementor' ). The theme then calls headfoot_render_header() and headfoot_render_footer() itself. These functions print the Below Header and Above Footer templates too.header and footer. The Below Header and Above Footer templates print next to the template parts.header.php and footer.php with a generic fallback.You can force a method on the tab Settings under Appearance, Header & Footer.
The generic fallback skips header.php and footer.php of the theme. If the theme opens wrapper elements in header.php and closes them in footer.php, the theme CSS that targets those wrappers stops working on the page content. If this happens, select the mode Theme support and call the plugin functions in the theme.
A Below Header or Above Footer template needs a place after the theme header or before the theme footer. Astra, GeneratePress, OceanWP, and block themes have one. In the generic fallback, in Hello Elementor, and in the mode Theme support, the template shows only together with a Header or Footer template of the plugin. A theme in the mode Theme support can call headfoot_render_below_header() and headfoot_render_above_footer() at the places it wants.
In a shortcode and in a block theme, the plugin escapes the template markup with wp_kses(). The plugin removes each script element and each event handler attribute, so the JavaScript of an HTML widget does not run there. The CSS of a style element goes to wp_add_inline_style(), and WordPress prints it with the other styles. The filter headfoot_kses_allowed_html changes the list of permitted elements and attributes.
The user role rule does not work with full page caching. A cached page for a logged out visitor serves the logged out header to everyone.
If Elementor Pro renders a theme builder template for the same location, the plugin yields to Elementor Pro. If Elementor Header & Footer Builder (Ultimate Addons for Elementor) is active, the plugin renders nothing, so the site never gets two headers.
Functions: headfoot_get_template_id( $type ), headfoot_header_enabled(), headfoot_footer_enabled(), headfoot_below_header_enabled(), headfoot_above_footer_enabled(), headfoot_render_header(), headfoot_render_footer(), headfoot_render_below_header(), headfoot_render_above_footer(), headfoot_get_header_html(), headfoot_get_footer_html(), headfoot_get_below_header_html(), headfoot_get_above_footer_html(), headfoot_get_template_html( $id ).
The type for headfoot_get_template_id() is header, below_header, above_footer, or footer. The functions headfoot_render_header() and headfoot_get_header_html() include the Below Header template after the header. The functions headfoot_render_footer() and headfoot_get_footer_html() include the Above Footer template before the footer.
Filters: headfoot_template_id, headfoot_rules, headfoot_rule_match, headfoot_header_wrapper, headfoot_below_header_wrapper, headfoot_above_footer_wrapper, headfoot_footer_wrapper, headfoot_kses_allowed_html, headfoot_theme_mode, headfoot_block_template_part_slugs.
Actions: headfoot_before_header, headfoot_after_header, headfoot_before_below_header, headfoot_after_below_header, headfoot_before_above_footer, headfoot_after_above_footer, headfoot_before_footer, headfoot_after_footer.