Title: The Loop at header.php
Last modified: August 18, 2016

---

# The Loop at header.php

 *  Resolved [fernandonery](https://wordpress.org/support/users/fernandonery/)
 * (@fernandonery)
 * [18 years, 10 months ago](https://wordpress.org/support/topic/the-loop-at-headerphp/)
 * Hello guys,
 * I need to put one The Loop at my header Templeate File, i’ve tried like this:
 *     ```
       <table width="108" cellpadding="0" cellspacing="0">
         <tr>
           <td width="102">
             <? query_posts("cat=81&posts_per_page=4"); ?>
             <?php while (have_posts()) : the_post(); ?>
               <p align="left" class="enquete"><?php the_title(); ?> <a href="<?php the_permalink(); ?>" title="Coluna - <?php the_title(); ?>">[ler]</a></p>
               <p align="left" class="enquete">&nbsp;</p>
             <?php endif; ?>
             <div align="center" class="enquete"><a href="http://www.potterish.com/index.php?p=col"><strong>[Leia Mais]</strong></a></div>
           </td>
         </tr>
       </table>
       ```
   
 * but it is not working, there ir another way to do this?
 * Thx

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [fernandonery](https://wordpress.org/support/users/fernandonery/)
 * (@fernandonery)
 * [18 years, 10 months ago](https://wordpress.org/support/topic/the-loop-at-headerphp/#post-610191)
 * I found my error, sorry
 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [18 years, 10 months ago](https://wordpress.org/support/topic/the-loop-at-headerphp/#post-610195)
 * For others reading this, his endif; should probably be an endwhile; instead.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘The Loop at header.php’ is closed to new replies.

## Tags

 * [loop](https://wordpress.org/support/topic-tag/loop/)

 * 2 replies
 * 2 participants
 * Last reply from: [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * Last activity: [18 years, 10 months ago](https://wordpress.org/support/topic/the-loop-at-headerphp/#post-610195)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
