Title: query_posts in header !!PROBLEM!!
Last modified: August 18, 2016

---

# query_posts in header !!PROBLEM!!

 *  [peacefulkarl](https://wordpress.org/support/users/peacefulkarl/)
 * (@peacefulkarl)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/query_posts-in-header-problem/)
 * I have a bit of a problem… I am trying to place a recent posts list in my header.
   When I do the index page looks great. The archive posts as well as all the pages
   are all wrong. The posts from the <?php query_posts(‘showposts=6’);?> put posts
   into the pages…
 * have a look
    [http://olsonimages.com/archives/44](http://olsonimages.com/archives/44)
   and [http://olsonimages.com/contact-me/](http://olsonimages.com/contact-me/) 
   it goes on…
 * this is the code I am using, I am wonder if there is anything that might prevent
   this from happening other than a redesign…
 * <?php query_posts(‘showposts=6’);?>
    <?php if (have_posts()) : while (have_posts()):
   the_post();?>
    -  <link to =”<?php the_permalink() ?>”><span class=”date”><?php the_time(‘m.
      j’) ?></span> <?php the_title() ?>
    -  <?php endwhile; endif; ?>
    - the about section is also doing the same thing…
       the code looks like…
    - <?php query_posts(‘pagename=about’); >
       <?php if (have_posts()) : > <?php 
      while (have_posts()) : the_post(); ?> <?php the_content(); > <;?php endwhile;
      > <?php endif; >
    - please help if you can, I dont know how to remedy this…
    - Thanks
       Karl

The topic ‘query_posts in header !!PROBLEM!!’ is closed to new replies.

## Tags

 * [about](https://wordpress.org/support/topic-tag/about/)
 * [posts](https://wordpress.org/support/topic-tag/posts/)
 * [query](https://wordpress.org/support/topic-tag/query/)

 * In: [Installing WordPress](https://wordpress.org/support/forum/installation/)
 * 0 replies
 * 1 participant
 * Last reply from: [peacefulkarl](https://wordpress.org/support/users/peacefulkarl/)
 * Last activity: [19 years, 1 month ago](https://wordpress.org/support/topic/query_posts-in-header-problem/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
