• amc11

    (@amc11)


    Hi!

    Im using the free Astra theme.

    I experiencing some issues with the Child theme that I generated from your site.

    Somehow things in header does not turn out that well using the child theme when using the following scripts in astra-child/functions.php (I want to run tablet breakpoints for desktop):

    add_filter( ‘astra_tablet_breakpoint’, function() {
    return 10077;
    });

    add_filter(‘astra_is_header_footer_builder_active’, ‘is_header_footer_builder_active_callback’);
    function is_header_footer_builder_active_callback() {
    return false;
    }

    Please, what can I do wrong?

    Thank you. Great theme!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hello @amc11,

    I’ve checked the code you provided, and it seems there’s an error with the apostrophe markup. You can view the screenshot here: error screenshot.

    Here’s the corrected code:

    add_filter( 'astra_tablet_breakpoint', function() {
        return 10077;
    });
    
    add_filter('astra_is_header_footer_builder_active', 'is_header_footer_builder_active_callback');
    function is_header_footer_builder_active_callback() {
        return false;
    }

    Kindly paste the filter in the child theme function.php.

    If you need further assistance, feel free to ask!

    Kind regards,
    Avinash

    Thread Starter amc11

    (@amc11)

    Hi,

    Thank you.

    Sorry, it didn’t make any difference. Your error must have happened when you copy pasted directly my text, mine has the same ‘ as yours in my code. I guess this forum adds ′ for posted threads.

    Thread Starter amc11

    (@amc11)

    Also weird, when using the code in parent Astra theme, in Functions.php it works correctly, the problem only occurs when code is placed in child theme Functions.php it goes wrong.

    • This reply was modified 11 months ago by amc11.
    xcloud

    (@xcloud)

    Hi @amc11,

    I’ve added the code to the child theme, and it’s functioning as intended. You can find the link to the child theme with the code added to the functions.php file.

    Additionally, I’m including a link to an article that explains how to add custom code without using a child theme.

    If you have any further questions or need assistance, feel free to ask.

    Kind regards,
    Avinash

    Thread Starter amc11

    (@amc11)

    Hi Avinash,

    It still doesnt work as it should.

    Please have a look at the following screenshots. With child theme active, and the code:

    add_filter( ‘astra_tablet_breakpoint’, function() {
    return 10077;
    });

    add_filter(‘astra_is_header_footer_builder_active’, ‘is_header_footer_builder_active_callback’); function is_header_footer_builder_active_callback() {
    return false;
    }

    It doesn’t work, it produces the following layout in header. The last image is correct, but that is when I load the above code in Functions.php within Astra parent theme.

    Wrong

    Correct

    • This reply was modified 11 months ago by amc11.

    Hi @amc11,

    Why would you add the following snippet?

    add_filter( 'astra_tablet_breakpoint', function() {
    return 10077;
    });
    
    add_filter('astra_is_header_footer_builder_active', 'is_header_footer_builder_active_callback'); function is_header_footer_builder_active_callback() {
    return false;
    }

    Would you like to disable the new Header Footer Builder (HFB) and back to the old Header/Footer?

    The following snippet is for the new HFB and will not work for the old Header/Footer.

    add_filter( 'astra_tablet_breakpoint', function() {
        return 10077;
    });

    If you would like to switch back to the old Header/Footer, which we do not recommend, and would like to update the Breakpoint, then you will need the snippet from this doc instead.

    I hope it will help.

    Kind regards,
    Herman ??

    Thread Starter amc11

    (@amc11)

    Thanks man great info!

    Well. My wish is to have two menus, one hamburger and another one as a basic menu to the right of logo. But the mobile menu do not show up on desktop version. So that is why ive added that code.

    Thanks ??

    Adrian

    Hi @amc11,

    Happy can be a help!

    Anyway, regarding the scenario you would like to achieve. I don’t think you can achieve it using the old Header/Footer. However, even using the new HFB, I don’t think you can achieve it with only the free Astra theme. The option to have the Toggle Button on the desktop view is available only with the Astra Pro plugin.

    Kind regards,
    Herman ??

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Child theme doesnt work as expected’ is closed to new replies.