Hook to return true when the_post() is used in a custom while loop

if you use the native wp_query to select posts instead of custom sql queries you can check against the have_posts() method of wp_query

tech