WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've noticed this a lot, when I export a database from a test site and import it into a live site, any (or most) page with a wp_query in it doesn't show up correctly (It shows the theme, but as though I'm viewing a page with no content in)

But if I create another page, using the same template as the one with the wp_query in it works just fine (As long as I don't give it the same slug). It also works correctly if I simply rename the page slug

Does anyone know why this might be? This is a sample wp_query that I use;

    $args = array(
        'post_type' => 'offers',
        'posts_per_page' => -1,
        'order' => 'asc'
    $offer_query = new WP_Query( $args );
    while ( $offer_query->have_posts() ) : $offer_query->the_post();


<?php endif; wp_reset_postdata();?>
share|improve this question
I notice issues sometimes when moving websites from local to live, but those issues are usually solved by visiting the Permalink configuration page. wp-admin/options-permalink.php I go there and just click save. Once you click save that ensures that the htaccess file is correct. – gdaniel May 14 '13 at 13:15

Moving a site from local to live should not effect queries like that one, where there are not hard-coded values like post IDs or post slugs that might have changed with the migration (depending on how you migrate).

What could conceivably be happening is that the page/page-template association gets broken. That information is stored in the $wpdb->postmeta table under the key _wp_page_template. Depending on how you migrated the associated post ID could be different than stored in the database. Your statement that "... if I create another page, using the same template as the one with the wp_query in it works just fine" seems to support the theory.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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