I have a post for my site’s logo and I have inserted its thumbnail in my header.php using the code below and it works fine:
<div id="logo"> <?php $my_query = new WP_Query('showposts=1&cat=12'); while ($my_query->have_posts()): $my_query->the_post(); $do_not_duplicate = $post->ID;?> <?php the_post_thumbnail( 'site-logo'); ?> <?php endwhile; ?> </div>
Beside this I have a single.php file where I show the details of a post using Advanced Custom Fields plugin’s codes and my problem is when I click on a post and I get redirected to single.php instead of seeing its thumbnail and details I see the site’s logo and the details are empty.
This happened right after I added my logo as a post and used that post’s thumbnail. Before that my single.php page was functioning very well.
How can I fix this without removing the logo? (Or if this problem is because of inserting logo this way recommend me a better way.)