Daily Tip: Remember to Reset Your Query After a Custom Loop

If you’re implementing some WordPress hacks you’ve found or calling a custom loop to show related posts after your post, make sure to reset the query. You can do this using wp_reset_query. It will destroy the previous query used on a custom loop. If you don’t use the reset, it’s possible that some strange things might happen on your page, such as the wrong comments showing for your post.

Here’s an example from the codex of how to use it with the reset shown at the end:

[member]

<?php

query_posts('showposts=5');

if (have_posts()) : while (have_posts()) : the_post();
?><a href="<?php the_permalink() ?>"><?php the_title() ?></a><br /><?php

endwhile; endif;

wp_reset_query();
?>

[/member]

Posted in Free | Comments Off

Introducing a brand new theme, Business Services

Today we’ve got a great new theme for you as the last of the theme a day run that’s been going on this week.  We’d like to introduce Business Services.  Business Services is all about showing your content no matter if it’s services, products or just great writing.

Continue reading

Posted in Free | Comments Off