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?
from
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');
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?
As I thought, this task is too difficult to solve. Or... anyone, please?
as you say...bump! I really need help with this one...please...
Could this be because I have placed the code in a text-widget?
Thanks moshu, then I have to place it ouside a widget.
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)