Site logo

Archived topic

Hooks in child theme

3 replies · Started by mikei on November 1, 2014

Viewing posts 1–4 of 4

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

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!

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' );
};

Glad to hear :)

This archived topic is closed to new replies.