Title: Problem with get_posts
Last modified: August 19, 2016

---

# Problem with get_posts

 *  Resolved [Richard Archambault](https://wordpress.org/support/users/richardmtl/)
 * (@richardmtl)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/problem-with-get_posts-1/)
 * I’m adapting the [HTML5 boilerplate wordpress theme](https://github.com/zencoder/html5-boilerplate-for-wordpress)
   and [this HTML5 layout](http://www.pvmgarage.com/downloads/portfolio/#) for a
   new site I want to build. Part of it so that I can expand my WordPress skills,
   so yes, I’m trying out some somewhat advanced techniques. But I’ve come across
   a wierd problem that I can’t figure out.
 * I based the following on this ([get_post with offset](http://codex.wordpress.org/Template_Tags/get_posts#Posts_list_with_offset)
 * So I have this:
 *     ```
       <ol id="archive-post-list"><!--list of posts-->
       <?php
        $postslist = get_posts('numberposts=3&offset=4');
        foreach ($postslist as $post) :
           setup_postdata($post);
        ?>
   
       			<li><article>
       				<header>
       				<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></h2>
       				</header>
       				 <?php the_excerpt(); ?>
       				 <footer>
       				<p><time datetime="<?php the_time('Y-m-d')?>"><?php the_time('F jS, Y') ?></time> | <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
       				</footer>
       			</article></li>	
   
       			<?php endforeach; ?>
       </ol>
       ```
   
 * Seems pretty straight-forward. Now look at the source that WP sends back to me:
 *     ```
       <ol id="archive-post-list"><!--list of posts-->
   
       			<li><article>
       				<figure class="float">
       				<!-- make this the SMALL featured image section later -->
       								</figure>
       				<header>
       				<h2><a href="http://richardmtl.ca/?p=1" rel="bookmark" title="Permanent Link to Hello world!">Hello world!</h2>
   
       				</header>
       				 <p>this is my excerpt</p>
       				 <p>Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!</p>
       				<footer>
       				<p><time datetime="2010-11-12">November 12th, 2010</time> | <a href="http://richardmtl.ca/?p=1#respond" title="Comment on Hello world!">No Comments »</a></p>
       				</footer>
   
       			</article></li>	
   
       			</ol>
       ```
   
 * Again, looks great, no problems there.
 * However, the behaviour of this section in the browser (whether it be FF, IE, 
   Chrome, Opera or Safari, the result is always the same) is completely different,
   and I can’t figure it out.
 * Look at what Firebug gives me (and this source represents what I acutally see
   happen in the browser):
 *     ```
       <ol id="archive-post-list"><!--list of posts-->
   
       			<li><article>
   
       				<header>
       				<h2><a href="http://richardmtl.ca/?p=1" rel="bookmark" title="Permanent Link to Hello world!">Hello world!</a></h2>
       <a href="http://richardmtl.ca/?p=1" rel="bookmark" title="Permanent Link to Hello world!">				</a></header>
       <a href="http://richardmtl.ca/?p=1" rel="bookmark" title="Permanent Link to Hello world!">				 </a><p><a href="http://richardmtl.ca/?p=1" rel="bookmark" title="Permanent Link to Hello world!">this is my excerpt</a></p>
       <a href="http://richardmtl.ca/?p=1" rel="bookmark" title="Permanent Link to Hello world!">				 </a><p><a href="http://richardmtl.ca/?p=1" rel="bookmark" title="Permanent Link to Hello world!">Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!</a></p>
       <a href="http://richardmtl.ca/?p=1" rel="bookmark" title="Permanent Link to Hello world!">				<footer>
       				</footer></a><p><time datetime="2010-11-12"><a href="http://richardmtl.ca/?p=1" rel="bookmark" title="Permanent Link to Hello world!">November 12th, 2010</a></time><a href="http://richardmtl.ca/?p=1" rel="bookmark" title="Permanent Link to Hello world!"> | </a><a href="http://richardmtl.ca/?p=1#respond" title="Comment on Hello world!">No Comments »</a></p>
       				</article>
       			</li>	
   
       			</ol>
       ```
   
 * See what I mean? Just a whole bunch of extra links for some reason. I don’t get
   it, since it’s not even represented in the source anywhere. How can Firebug and
   the browsers see this, but “View Source” doesn’t show it? And what did I do to
   cause this? I don’t get it at all.
 * Can anyone help me out? 🙂
 * Thanks!

Viewing 1 replies (of 1 total)

 *  Thread Starter [Richard Archambault](https://wordpress.org/support/users/richardmtl/)
 * (@richardmtl)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/problem-with-get_posts-1/#post-1772134)
 * And of course, it was my own fault; I had some unclosed tags.. duh..

Viewing 1 replies (of 1 total)

The topic ‘Problem with get_posts’ is closed to new replies.

## Tags

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

 * 1 reply
 * 1 participant
 * Last reply from: [Richard Archambault](https://wordpress.org/support/users/richardmtl/)
 * Last activity: [15 years, 6 months ago](https://wordpress.org/support/topic/problem-with-get_posts-1/#post-1772134)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
