Title: Second loop
Last modified: October 25, 2017

---

# Second loop

 *  Resolved [sorhaug](https://wordpress.org/support/users/sorhaug/)
 * (@sorhaug)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/second-loop/)
 * Hi,
    I try to add a video background to my page, but have found that it will 
   not display unless I disable the second loop at the bottom of the page. As soon
   as I enable the query_posts string the video disappears. Is there a simple explenation
   to this, or a trick to fix it?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fsecond-loop%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [sorhaug](https://wordpress.org/support/users/sorhaug/)
 * (@sorhaug)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/second-loop/#post-9620061)
 * … and there I found it! wp_reset_query(); did the trick!
 *  Plugin Author [pushlabs](https://wordpress.org/support/users/pushlabs/)
 * (@pushlabs)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/second-loop/#post-9630435)
 * Hi sorhaug,
 * Thanks for your question! I’m glad you got the issue resolved.
 * I’m going to elaborate a little bit on what’s going on here, just in case someone
   wonders across the same issue 🙂
 * Video Background uses the custom fields for each post or page the video background
   is set on. As a result, video background relies on being able to use the $post
   ID to find the custom fields information, and to display the video background.
   When a new WP Query is established, the post ID changes based on the query created.
   When the Query is not closed using wp_reset_query(), Video Background tries to
   pull the custom fields data from the post ID of the WP Query, instead of the 
   page or post.
 * In short, be sure to close your queries with wp_reset_query() 🙂
 * Blake

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Second loop’ is closed to new replies.

 * ![](https://ps.w.org/video-background/assets/icon-256x256.png?rev=2774411)
 * [Video Background](https://wordpress.org/plugins/video-background/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/video-background/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/video-background/)
 * [Active Topics](https://wordpress.org/support/plugin/video-background/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/video-background/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/video-background/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [pushlabs](https://wordpress.org/support/users/pushlabs/)
 * Last activity: [8 years, 5 months ago](https://wordpress.org/support/topic/second-loop/#post-9630435)
 * Status: resolved