Themeco’s Pro Header Builder is pretty amazing. From it’s in depth controls to endless styling options, anyone can make a truly magnificent header. But what do you do when the specific page you’d like to target isn’t available as an assignment? How about when you want to show a specific header for logged in users? Or for different user roles?
This little PHP snippet will do just that. But first, you need to get the post ID of the header you’d like to assign. The easy way to do that is to simply hover over the Edit link in the builder, and take a look at the URL in your status bar. It should look similar to domain.com/x/#/headers/1234
That 1234 is the post ID you need for this snippet. Want a custom header on your search results page? Place this in your child theme’s functions.php file:
Simple as that!
What else can you do with this code? Well, how about your 404 page?
How about a different header for logged in users?
And for user roles? Here’s one for authors:
How about assigning headers to multiple pages?
You get the idea. Feel free to mix and match as needed to create the custom header assignments you need for you site.