Get the post titles and links for post 6 to 10
-
Hi
I have been trying to get this to work for a while now but everything i have tried seems to not work 100%. Currently i have the first 5 post titles displaying and then i have a show more button set up to display the next 5.
The code i am using for the first 5 is:
<?php $current_author = get_query_var('author'); $author_posts= get_posts( 'author=2&posts_per_page=5' ); if($author_posts){ echo '<ul class="author-articles">'; foreach ($author_posts as $author_post) { echo ' <li><a>ID).'">'.$author_post->post_title . mysql2date('j M Y', $post->post_date);'</a> </li> '; } echo ''; } ?>
And then to try and get the 6th to 10th post i have tried to change
$author_posts= get_posts( ‘author=2&posts_per_page=5’ );to
$author_posts= query_posts('author=2&showposts=10&offset=6');
But it will generate the titles and then display the content of each post as well which i dont want
Any help is appreciated
[Moderator Note: Please post code & markup between backticks or use the code button. Your posted code has now been damaged by the forum’s parser.]
- The topic ‘Get the post titles and links for post 6 to 10’ is closed to new replies.