Creating a custom header with child theme

Happy Friday!

FYI, I’m utilizing Pro.

I’m familiar with child themes and am comfortable using them, but Pro is a little complex in that issue for some parts. Most of the time I don’t need to worry about it aside from some work with Functions.php, but I’d like to do a little more customization.

I tend to hand-write my header markup, and up until now I’ve always just “made it work” in the Pro header by placing the code in the header builder content area itself, but this time around I’d like to remove that little extra bit of overhead, as I’ve got a slightly more complex header build coming down the pipe (you can see the “in progress” markup here: https://classicwfl.com/ego/).

So, obviously, child theme.

Question is… Which file(s) do I modify? I’ll also be building custom template files for posts, but I’m pretty confidence I know where to grab those to pop into my child theme.

Thanks.

Hello @classicwfl,

Thanks for writing in!

Once you have your child theme active and ready, please follow the following steps below:
1] Using Notepad or TextEdit or Sublime Text or any text editor, please create a new file in your local machine.
2] Insert the following code into that new file

<?php

// =============================================================================
// VIEWS/HEADER/MASTHEAD.PHP
// -----------------------------------------------------------------------------
// Masthead markup.
// =============================================================================

$atts = x_atts( apply_filters( 'x_masthead_atts', array(
  'class' => 'x-masthead',
  'role'  => 'banner'
) ) );

?>

<?php do_action( 'x_before_masthead_begin' ); ?>

  <header <?php echo $atts; ?>>

    <?php do_action( 'x_after_masthead_begin' ); ?>

    <?php do_action( 'x_masthead' ); ?>

    <?php do_action( 'x_before_masthead_end' ) ?>

  </header>

<?php do_action( 'x_after_masthead_end' ); ?>

3] Save the file named as masthead.php
4] Upload this file to your server in the child theme’s folder wp-content/themes/pro-child/framework/views/header/

Please keep in mind that the header does not contain any code. Most of it, will be added with the custom builder.

Please note that custom coding is outside the scope of our support. Issues that might arise from the use of custom code and further enhancements should be directed to a third party developer.

Regards.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.