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)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Displaying posts -limit’ is closed to new replies.