You can use this before the second loop
<?php rewind_posts(); ?>
Resource:
http://codex.wordpress.org/The_Loop#Multiple_Loops_Example_1
Thanks!
Unfortunately using rewind_post doesn’t seem to work. Here’s my setup:
‘<?php query_posts(‘pagename=home’); ?>’
‘<?php if (have_posts()) : while (have_posts()) : the_post(); ?>’
‘<?php the_content(); ?>’
‘<?php endwhile; endif; ?>’
‘<ul’>
‘<?php rewind_posts(); ?>’
‘<?php if (have_posts()) : while (have_posts()) : the_post(); ?>’
‘
However if I put another blank query_posts() after the rewind call, it seems to work to output the regular posts, but with an argument error at the beginning
Ooops, something went wrong there, here it is again:
‘<?php query_posts(‘pagename=home’); ?>’
‘<?php if (have_posts()) : while (have_posts()) : the_post(); ?>’
‘<?php the_content(); ?>’
‘<?php endwhile; endif; ?>’
‘<ul’>
‘<?php rewind_posts(); ?>’
‘<?php if (have_posts()) : while (have_posts()) : the_post(); ?>’
‘
Are you trying to make a front/home page that also displays the recent posts?
If yes, you are overcomplicating it…
I am making a homepage:
+ There is a Page that I created called ‘homepage’ which I’d like to be able to edit simple content directly from the wp-admin. I also want this content to show up on the actual home.php homepage.
+ I also want to show the most recent posts.
Is there a better method for executing this objective?
Well, in 2.3 the home.php template file is obsolete – it was necessary only in earlier versions to have a custom frontpage.
Recently I put together a guide about having a static frontpage with dynamic content. See if that helps.
Thanks, I’ve tried this method out, and I’m still running into the problems.
Whether or not I’m doing this efficiently or not, I’d still like to know if the following is severely flawed, because it looks like a legitimate routine:
1. query_posts(‘page_id=20’)
2. while (have_posts()) : the_post()
3. output content
then
4. rewind_posts()
5. query_posts(‘order=DESC’)
6. while (have_posts()) : the_post()
7. output content
This routine still outputs the right page I want in steps 1-3.
However, steps 4-7 always outputs the same posts when they are paged. For example, I have 10 posts in the database marked Post A to Post J, but only posts A through E keep showing up on each paged output.
Eureka! I found a working solution:
http://wordpress.org/support/topic/97147
Being specific about a page call seems to work better than trying to run a filtered query routine.
how to use query_post(‘pagename=()’)
where I wish to make it to detect the current loaded page name?
thanks