Custom header design

Newbie here…

I went through some of the posts and couldn’t find an answer except for maybe this one http://forum.wpbeaverbuilder.com/support/q/how-to-customize-the-header-globally/ but I am not sure how to do hooks.

I currently have pages set up with a template but when it comes to the blog post pages, these will have to be set each time and my client is not going to want to do that. I have been playing around with actual header settings in the customizer but I can’t seem to recreate what I need like I did in the page template using rows. Is there a way to recreate this in the header? I wish there was an easier way to create a header such as adding rows, etc., like you can in the pages.

Thanks!

Michelle

Hey Michelle,

Sorry to say but the only easy way around that would be to use hooks. Hooks are basically just points in the template that you can hook content to. Check the KB article below for more info on our theme’s hooks. You can even try the codes so you can see how they work! :slight_smile:
http://forum.wpbeaverbuilder.com/knowledge-base/theme-action-reference/

So for example, we have the fl_before_content and fl_after_content hooks. If you place the code below to your child theme’s functions.php file, it adds the contents to those areas respectively, even on your single posts.

function my_before_content() {
  echo '<div> I am right before the content div. </div>'; 
} 
add_action( 'fl_before_content', 'my_before_content' );

function my_after_content() {
  echo '<div> I am right after the closing content div. </div>'; 
} 
add_action( 'fl_after_content', 'my_after_content' );

So the idea here is, instead of inserting those sentences, we can call an entire layout using the shortcode that we have implemented just recently. Take a look at the KB article below for more info.
http://forum.wpbeaverbuilder.com/knowledge-base/shortcodes/

So for the header, if you want to pull out the template with the slug header_template before your content, you can use the code below.

function my_before_content() {
  echo do_shortcode('[fl_builder_insert_layout slug="header_template"]'); 
} 
add_action( 'fl_before_content', 'my_before_content' );

Hope this helps!

Ben

Thank you. I will let you know if I have any problems.

No worries at all! :slight_smile:

Ben

This worked great! Thank you!

Awesome! And no worries at all, Michelle. :slight_smile:

Enjoy BB!

Ben