Header not appearing in copy of page template

Could you please tell me why the header is not appearing on this page?
get_header () isn’t running.
http://staging.jeremyborum.com/

I’m using a copy of your page template template-blank-6.php and styling it to have a transparent background with style.css, but that shouldn’t affect the header.

My page template file is x-child/framework/views/ethos/template-hero-image.php. The contents are identical to X’s stock template: template-blank-6.php. The file contains this header code:
if ( apply_filters( 'x_legacy_cranium_headers', true ) ) { x_get_view( 'global', '_header' ); } else { get_header(); }

When I reduce this code to simply read get_header(); then it works. Why would the conditional statement above work in the default templates from X and not in my copy of it?

Many thanks.

Hey @jborum,

template-blank-6.php is the Blank - No Container | No Header, No Footer template. It will not display the header and footer. Try template 5. Here’s the best practices in customizing X.

Thanks.

I see. Thank you.

The only difference between those two templates is the change I mentioned above. The if-else logic about x_legacy_cranium_headers is simply replaced with get_header();

Could you please tell me what legacy cranium headers are? I misunderstood that, and therefore misinterpreted the entire if clause. From what I can tell they appear to be headers from X v4 and earlier, but I’m not sure if I’m using them or not. I started this site build some time ago, and it could have been with v4.

I think I’m NOT using legacy headers, but it would be nice to know since I will upgrade to Pro soon.

Much appreciated.

Did you see what Christian mentioned above about template 6? It doesn’t output the header at all. That condition is to make sure you still get the opening HTML boilerplate, but not the header area.

If you want a header, you should copy the contents of a template that is setup to output one.

Also, I thought this might help you. If you are using a template only for the purpose of getting a class to style, you can use the “Body CSS Class” feature available on every page when editing in the WordPress dashboard.

Thanks for clarifying about the opening HTML boilerplate. That makes sense.

Also, thanks for the tip about using a body class for an individual page. I might not need a unique template file at all.

We are delighted to assist you with this.

Cheers!

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