How to have customized header.php for specific page
-
Hi, I am using the Avada theme and trying to figure out how to have a custom header.php for a specific set of pages.
The default theme layout options don’t allow you to add full-width content in a page that has sidebars enabled. All your content falls into the main body, and I want the content to go above main body and sidebar.
So far, I have created a custom page template (page-workplaces.php) and referenced a custom header template (header-workplaces.php), and placed both in a child theme.
From here, I was instructed to
create a std page in WP and then in the header file using PHP to call that page and it’s content into position:
<?php if ( is_front_page() ) { $subPageHeader = new WP_Query("page_id=25″); >while($subPageHeader->have_posts()) : $subPageHeader->the_post(); ?>
These instructions are incomplete and I need a layman’s explanation of how to achieve this. For example, I don’t understand how to call a page in a php file.
You can see a mock-up of what I’m trying to achieve here. The four content items: Our Issues, Our Contract, Opportunities, Q&A is what I’m trying to add.
Thank you.
- The topic ‘How to have customized header.php for specific page’ is closed to new replies.