beaverbuilder / feature-requests

Feature request board for Beaver Builder products.
26 stars 4 forks source link

Add filter to themer to disable header #374

Open FelixVicis opened 2 months ago

FelixVicis commented 2 months ago

Is your feature request related to a problem? Please describe.

I recently had an issue where I was trying to make a variant on the theme template No Header/Footer for specifically a No Header template in a page where I wanted custom navigation. I had copied the template over and changed the filters to show only the footer but my header was still there.

I realized that it was the themer header displaying and needed to disable the theme header for that page.

Describe the solution you'd like

I'd like for an update to /bb-theme-builder/extensions/themes/classes/class-fl-theme-builder-support-bb-theme.php to add a filter like

$show_themer_header = apply_filters('fl_themer_header_enabled', true);

where the themer header can be disabled without having to add an exception to each page.

Describe alternatives you've considered

As said above, an easy UI solution is to add the page as an exception. Another alternative that I'm using in the meantime is to add the following line to my template so that it's more themer aware:

remove_action( 'fl_before_header', 'FLThemeBuilderLayoutRenderer::render_header', 999 );

Additional context

For anyone else looking for a BB No Header template for use with themer I've added my code below

<?php
/*
Template Name: No Header
Template Post Type: post, page
*/

add_filter( 'fl_topbar_enabled', '__return_false' );
add_filter( 'fl_fixed_header_enabled', '__return_false' );
add_filter( 'fl_header_enabled', '__return_false' );
remove_action( 'fl_before_header', 'FLThemeBuilderLayoutRenderer::render_header', 999 );
add_filter( 'fl_footer_enabled', '__return_true' );
get_header();

?>
<div class="fl-content-full container">
    <div class="row">
        <div class="fl-content col-md-12">
            <?php
            if ( have_posts() ) :
                while ( have_posts() ) :
                    the_post();
                    get_template_part( 'content', 'page' );
                endwhile;
            endif;
            ?>
        </div>
    </div>
</div>

<?php get_footer(); ?>
codente commented 3 weeks ago

We will look into this.