[Resolved] Hooks in child theme

Home Forums Support [Resolved] Hooks in child theme

Home Forums Support Hooks in child theme

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #43446
    mikei

    Hi Tom,

    I added a sidebar below header. I was able to do it directly in the header.php (still in child theme) or by using the generate hooks addon. Child functions.php didn’t work for the same purpose. I tried deactivating the addon, that didn’t help. I tried using ‘generate_after_header’ hook. Is it supposed to work in child theme functions? Or maybe not, because of the addon for that?

    Thanks

    #43589
    Tom
    Lead Developer
    Lead Developer

    It should work perfect in a child theme.

    Can you possibly show me your function that you’re hooking into generate_after_header?

    Just be sure to highlight your code and click the “code” button in the editor here.

    Thanks!

    #43674
    mikei

    My bad, works perfectly with the addon either enabled or disabled.

    add_action('generate_after_header', 'mytheme_add_top_sidebar');
    function mytheme_add_top_sidebar() {
    return get_sidebar( 'top' );
    };
    #43699
    Tom
    Lead Developer
    Lead Developer

    Glad to hear 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.