List Posts in Header.php
-
I have attempted to use the Multiple Loop examples, as well as combed through the Loop codex page. I have tried various things like setting up two loops but I can’t seem to get posts to list in the header without messing up the index page.
The code below has always worked for me throughout my other templates I’ve worked with, but I have never tried listing posts in the header section. Is there any way to do it without creating another loop? I can’t seem to get two loops to function properly after following the instructions multiple times.
I want to basically have a “Featured” section at the top of the blog but listed in plain text with links.
<?php query_posts('category_name=jihad-watch&showposts=1'); while (have_posts()) : the_post(); // do whatever you want ?> <h2 class="jwEntryTitle"><a target="_blank" href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2><br /> <p><?php print string_limit_words(get_the_excerpt(), 100); ?>...</p> <?php endwhile; ?>
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘List Posts in Header.php’ is closed to new replies.