I am creating a custom php file to control a serial number search. My code is below;
if($found2){
get_header();
?>
<div class="x-container max width main">
<div class="offset cf">
<div class="<?php x_main_content_class(); ?>" role="main"></div>
<?php> $query = new WP_Query(array(
'meta_value' => trim($name)));
if($query->have_posts()) : while($query->have_posts()) : $query->the_post();
x_get_view( 'ethos', 'content', 'page' );
if (has_post_thumbnail()) {
?>
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_post_thumbnail(); ?></a>
<?php
}
?>
<h2><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<?php
//the_excerpt(); // or the_content(); for full post content
endwhile;endif;
get_sidebar();
get_footer();
}
Currently, it results in a page that gives me the posts and the sidebar along with some formatting, but the actual header is missing from the page. See image:
If I remove the get_header() the page formatting goes away and I’m left with just the post title as a hyper link, plain text, and a basic html search bar.
The php file is located in my public_html file not my theme file. What do I need to do to get my header on this page?