wordpress help of the day
- Started
- Last post
- 5 Responses
- acescence0
you can't use query_posts multiple times on the same page. query_posts is for modifying the main loop on a page with new parameters. for the second and third loops, you have to create new queries...
$my_second_query = new WP_Query( 'category_name=music&posts_per_p... );
while ($my_second_query->have_posts()) : $my_second_query->the_post();
// loop stuff
endwhile; endif;$my_third_query = new WP_Query( 'category_name=live&posts_per_pa... );
while ($my_third_query->have_posts()) : $my_third_query->the_post();
// loop stuff
endwhile; endif;- i have no idea what any of that means but thanks very much - i'll give it a gohans_glib
- FallowDeer0
im no wordpress master but I managed to get different loops working on this site http://www.ladybehave.com/blog/ using post query
But I think it is better using the above method
- it's possible in some cases, but some global variables don't get reset and plugins that rely on the loop will breakacescence
- Yea I wouldnt use my method if I was releasing a downloadable theme no wayFallowDeer
- hans_glib0
OK that all works really well, thanks acescence.
got another one for you... how to make WP generate a thumbnail of an image used in a post, and add it to the excerpt on the home page. I tried the "Thumbnails For Excerpts" plugin but can't seem to get it to respond properly. Any other ideas? Currently I'm on the prowl for a theme that might have this functionality built in, but any help would be much appreciated.
- meffid0
It would be faster to custom build this whole site than use wordpress.
- you're telling me. but i don't have the capabilities or cashhans_glib
- and at least i'm learning a lot about wordpress...hans_glib
- faster to custom build a whole admin back end? that's ridiculous. maybe just a static page, but that's pretty useless for his purposes.acescence
- i meant it would be faster for someone clever to build it from scratch than me struggle with WPhans_glib
- but thanks to you and kodap it's looking and working ok so farhans_glib
- hey, give yourself some credit man! I think you've still got a head start, you can do it!acescence
- kodap0
You will need to add few lines of code in the file "functions.php" , and then call that function where //loop stuff is.
I'll give you an example: