arras-theme icon indicating copy to clipboard operation
arras-theme copied to clipboard

Reset WP_Query in arras_document_description()

Open mattyrob opened this issue 12 years ago • 0 comments

The above named function is called from the library/template.php file, it creates a call to have_posts() and essentially pushes WordPress into "the_loop()" earlier that would normally be expected. This can have unexpected consequences in many other areas.

One suggestion would be to fine an alternative way of getting the code you need but a quicker interim fix might be to reset the WordPress query once this function finishes by adding:

wp_reset_query();

into the function, either at the end or just after the have_posts() loop.

mattyrob avatar Oct 05 '12 15:10 mattyrob