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.
Related Posts:
- How to display page content in a page template?
- Single page theme
- Single page theme that uses pages for the content
- Trying to list out child pages with WP_Query
- Front End Sorting Questions
- What are the differences between “Latest Posts” and “Static Page”?
- WP_Query doesn’t get sticky post at the top, when used in a page template
- Pagination of a WP_Query Loop in a child-page page template
- list pages using page.php and NOT page-{slug}.php
- Get pagination working for custom loops within page templates
- How is WP_Query parsed to determine which template to request?
- WordPress Pagination changes my template
- add_filter(‘query_vars’) not working in custom template
- Pass $page_id to new WP_Query
- Pagination on template page for custom query redirecting to index.php
- Create a page template for “top rated posts” but show full content and not just a list
- WP_Query returns different results from get_posts() [closed]
- inserting content of 1 Post to in another with a template hierarchy
- How to generate feed for custom template
- WP_Query with multiple orderby NOT working with ASC and DESC, what’s wrong?
- wp_query on page template not working (Genesis framework)
- Pagination for custom loop on custom page template is not displaying anything
- How to create Page templates for showing Blog posts in different layouts?
- Page template doesn’t display simple HTML if inserted into other page?
- How to separate two columns from one content on a page template?
- What’s the best way to make a blog page on WordPress?
- How to use custom page for all posts with custom url, call another directory?
- INNER JOIN custom tables – SQL Query
- Pagination Shows Up But Won’t Work on Custom Gallery Page
- How to exclude posts by ID within a category/archive loop
- How can I use a specific wordpress page template if certain words are used in page title [closed]
- Fetching $_POST from Page Template into functions.php
- Using URL variables on a custom WP_Query
- Pagination is not working on custom query inside a custom home page template
- Passing query variables to a custom page template
- Having trouble using this post category query on multiple pages?
- Adding css tweak based on page template
- WordPress pagination returns the same posts
- How do I query for posts by partial meta key?
- Display products from specific category in shop page
- meta_query where value is equal to given value
- Query by meta_key and order by meta_value_num return orderby date
- How to display most recent posts that haven’t already been displayed with WP_Query?
- What is the difference between these two custom queries?
- WP Query post meta value
- Understanding the use of wp_reset_query();
- WordPress posts per page WP_Query
- WordPress WP_Query orderby being overwritten
- Multiple meta queries but arrange by specific meta value order
- WooCommerce Only OnSale Products Loop Snippet [closed]
- pre_get_posts order by not working
- How to display specific posts with WP_Query?
- What is the random string I am seeing when I use get_query_var?
- Querying on multiple taxonomies pulled from $_GET checkbox array not working?
- How to get all child pages in their parent page?
- WP_Query order result by date AND meta_value
- How to display summary content from a Page (Not a Post) on another page
- Custom Search Not Consistent with Results
- how do we display all posts from a particular category in homepage?
- Display both standard posts in a specific category along with a custom post type in a single loop?
- Orderby is working with one query but not with other
- meta_query in WP_Query value is not accepting array
- Add capabilities via plugin for another plugin
- Two loops on archive page
- How to order posts by title after they have already been sorted by category
- Meta Query relation “AND” then set array accordingly
- Query with meta_query and tax_query together not working properly
- Adding a tax_query to a WP_Query Object
- wp_query search not taking keywords with together for multiple words
- Adding a html class based on post count
- meta_query fails to compare on values containing apostrophes
- How to Display Shortcode in the correct location, currently displaying before content after Page Title?
- Filtering posts by archive showing all years
- WP_Query posts_per_page strange caching
- wp_query show all values
- add_query_arg to compare and display events from a certain date
- WordPress dynamic AJAX query
- Custom Taxonomy Breaks Pages
- WP_QUERY tax_query not working
- Order post by modified date
- Custom query to retrieve oldest post and retrieve others with date interval
- Custom order revolution sliders post base slides as inserted in Specific Posts List field
- How to display Woocommerce products list by tag
- Order 2 meta_queries differently in WP_Query?
- Unable to reset post data in wordpress custom query
- Slow wp_posts and wp_postmeta query using Advance Custom Fields
- Get posts with any value in attribute
- WP_Query & shortcode : Return 3 articles from a category WordPress
- how to get dynamic data on wordpress from codeigniter?
- Pagination in WP_Query?
- 2 Loops on one page – pagination of 2nd loop ignore array of excluded posts
- WordPress Prevent 404 on missing custom post
- How to add archives (with pagination) to page template?
- Custom WP_Query with SQL directives for getting posts by authors and terms
- No content found on page 2 of pagination with 1 post per page
- pre_get_posts redirecting
- Hook to get the query result after listing posts
- WordPress WP_Query Search (‘s’) With Multiple Search Terms
- I want to place a post before all others from an ACF boleen field
- How to put posts with some taxonomy on top of others in `pre_get_posts`