Title: Displaying posts -limit
Last modified: August 19, 2016

---

# Displaying posts -limit

 *  [ThorHammer](https://wordpress.org/support/users/thorhammer/)
 * (@thorhammer)
 * [18 years ago](https://wordpress.org/support/topic/displaying-posts-limit/)
 * Using 2.6.1 and a custom theme.
    On my page I display the 14 latest posts with
   thumbnails and so on. (1-14).
 * I would like to display the following 10 posts (older posts – 15-25) just as 
   title links on a widget at the bottom of the page. I know I must use this code
   to display posts:
 *     ```
       <ul>
       	 <?php
       	 global $post;
       	 $myposts = get_posts('numberposts=10');
       	 foreach($myposts as $post) :
       	 ?>
       	    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
       	 <?php endforeach; ?>
        </ul>
       ```
   
 * and I also know that the $offset variable must be used to limit the posts, – 
   but how? I have read in the codex but I just dont got any smarter… With the code
   above I just re-display 10 of the last 14 posts already showed. Could anyone 
   please explain me?

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

 *  [myinstinctwaswrong](https://wordpress.org/support/users/myinstinctwaswrong/)
 * (@myinstinctwaswrong)
 * [18 years ago](https://wordpress.org/support/topic/displaying-posts-limit/#post-852975)
 * from
    [http://codex.wordpress.org/Template_Tags/get_posts](http://codex.wordpress.org/Template_Tags/get_posts)
 * midway down the page is a section called Parameters – in there, they mention 
   $offset
 * try
 * `$myposts = get_posts('numberposts=10&offset=14');`
 *  Thread Starter [ThorHammer](https://wordpress.org/support/users/thorhammer/)
 * (@thorhammer)
 * [18 years ago](https://wordpress.org/support/topic/displaying-posts-limit/#post-853181)
 * Well, I tried to include the following code on my widget:
 *     ```
       <ul>
                    <?php
                    global $post;
                    $myposts = get_posts('numberposts=10&offset=14');
                    foreach($myposts as $post) :
                    ?>
                       <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
                    <?php endforeach; ?>
        </ul>
       ```
   
 * But it was just – blank. Nothing there. Any advice?
 *  Thread Starter [ThorHammer](https://wordpress.org/support/users/thorhammer/)
 * (@thorhammer)
 * [18 years ago](https://wordpress.org/support/topic/displaying-posts-limit/#post-853204)
 * As I thought, this task is too difficult to solve. Or… anyone, please?
 *  Thread Starter [ThorHammer](https://wordpress.org/support/users/thorhammer/)
 * (@thorhammer)
 * [18 years ago](https://wordpress.org/support/topic/displaying-posts-limit/#post-853224)
 * as you say…bump! I really need help with this one…please…
 *  Thread Starter [ThorHammer](https://wordpress.org/support/users/thorhammer/)
 * (@thorhammer)
 * [18 years ago](https://wordpress.org/support/topic/displaying-posts-limit/#post-853225)
 * Could this be because I have placed the code in a text-widget?
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [18 years ago](https://wordpress.org/support/topic/displaying-posts-limit/#post-853226)
 * PHP in text widget doesn’t work.
 * [http://wordpress.org/extend/plugins/php-code-widget/](http://wordpress.org/extend/plugins/php-code-widget/)
 *  Thread Starter [ThorHammer](https://wordpress.org/support/users/thorhammer/)
 * (@thorhammer)
 * [18 years ago](https://wordpress.org/support/topic/displaying-posts-limit/#post-853227)
 * Thanks moshu, then I have to place it ouside a widget.
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [18 years ago](https://wordpress.org/support/topic/displaying-posts-limit/#post-853228)
 * Didn’t I just give you the link to a PHP widget?
    (I hate when people talk back
   before trying out what I just suggested)

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

The topic ‘Displaying posts -limit’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 8 replies
 * 3 participants
 * Last reply from: [moshu](https://wordpress.org/support/users/moshu/)
 * Last activity: [18 years ago](https://wordpress.org/support/topic/displaying-posts-limit/#post-853228)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
