If I include a new wp_query within another query's loop (e.g. putting even a very simple query, like the ones from the codex example on a single page template) the page loads as expected, but the title changes to "waiting for..." plus whatever the page name is.

The page loads in a good time, but the title thing is worrying me - why is this happening, and could it be causing a memory leak?

  • 2
    Without your code, it is difficult to tell. What exactly are you trying to do – Pieter Goosen Jul 10 '15 at 12:04
  • 2
    That sounds to me like there is a filter on the_title or something about how title strings are concatenated may be messing things up, but as Pieter said, without the code it is going to be hard to answer. – s_ha_dum Jul 10 '15 at 14:44

No there is no issue you can use query inside a loop with the help of reset post data and query

  • wp_reset_query() - ensure that the main query has been reset to the original main query

  • wp_reset_postdata() - ensures that the global $post has been restored to the current post in the main query.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.