Check to see what you’re getting. The new WP_Query()
isn’t working for some reason. Do a var_dump
on it. I suspect that you aren’t getting any results from the query, resulting in a Trying to get property of non-object
when you try to access the methods.
Related Posts:
- Get Recent Posts by Date in Multisite
- switch_to_blog() performance considerations & alternatives
- Merging multiple wp_query objects
- Multisite wp_query & switch_to_blog issue
- Get posts from Network (Multisite)
- WP_Query on different site in a multisite setup
- How to get post from all Blog Multisite to the Main Site?
- Get posts from the Main site to sub site – WordPress MultiSites Network
- How can i get the last post from wp multisite?
- Remove ellipsis from the excerpt retrieved using get_the_excerpt()
- How to find a post id using the post_excerpt?
- Return only post(s) which have post_excerpt
- Database Queries Optimization with new WP_Query
- WordPress multisite – fallback on subsites to main site on 404 and dealing with switch_to_blog function
- Need Help For WPQuery
- Multisite – Global CPT – advices?
- $WP_Query: How to display excerpt on first post only
- has_excerpt() not working inside wp_query
- Why is get_the_excerpt returning full content
- In a WordPress multisite configuration, how do I instruct WP_Query() to return posts from a sub-site?
- custom excerpt is not being shown
- Different query result on local and server
- Problem with infinite scroll on multisite with custom query
- Get the excerpt by page ID from another blog in a wordpress multisite?
- the_excerpt() not working in custom archive
- embedding shortcodes in php template
- WP_Query with page_ids in arguments without a result
- Add URL Rewrite Rule To WordPress
- Display recent posts on another site
- WP_Query for products always returns empty
- Get the child category ID of current category
- Child pages not affected by orderby
- Querying a large number of posts including their custom fields data
- Write WP Query that selects posts that are part of the same two categories
- How to get posts by category and by choosing a taxonomy term?
- Group posts by attachment meta key
- Error in meta_query not get result
- date_query is showing duplicate results
- Ordering posts by custom field and grouped by month
- Related Posts Excluding Certain Categories
- Paging + WP Query
- Getting the permalink to the latest post from a category
- Sort posts according to date
- is_404() – where does this get set?
- How to restrict search on a certain page to only return results against custom taxonomies?
- wp_query on page template not working (Genesis framework)
- Pagination for custom loop on custom page template is not displaying anything
- Display posts by tag
- Does putting queries within loops cause an issue on WordPress?
- Multisite switch to blog
- wp_query get attachments in larger size
- Display post meta conditionally based on it’s value
- Force WordPress to be more random
- pass parameters through variable to WP_QUERY
- Show posts of an advanced search form
- Overriding $wp_query on a template
- Query using string from custom field as array value
- Add parameter to first post only
- Creating attachments archive in tags and categories
- Function to retrieve IDs of posts, cache results, and improve wp_query
- How to use ‘WP_Query’ or ‘query_posts’ to display content in a descending order
- What is wrong with my WP_Query Arguments?
- How to display specific ids of posts using wp_query?
- Query of all pages, including children, ordered by meta key
- Get next/prev image/attachment in time with date query
- parse_tax_query causing Navigation Menu To Disappear
- How to view all posts of current day as default in admin
- WP_Query will not display draft posts
- Filtering by multiple conditions in the loop
- Limit loop to future events
- WP_User_Query orderby meta_val_num
- Hiding carousel indicators if there’s only one post
- How to show list of posts with custom field value (a date) that are coming soon
- Query Taxonomy By Page Title
- All Posts Have The Same Comments
- add_query_arg to compare and display events from a certain date
- WP_query is not returning the expected result
- Trying to get property of non-object in: $wp_query
- Filter out a meta key in the Search results page with two CPT
- WP_Query custom order and pagination
- How to access $wp_query object from array of posts given by get_posts?
- Custom navigation : show posts in sets of 4
- Function using get_posts() with tax_query not working when called from functions.php
- Why does WP_Query have methods that return public properties of the same name
- WordPress dynamic AJAX query
- How to add WordPress featured image via SQL
- show custom category posts from a custom post type
- how to load posts to a custom post template after using template_redirect or template_include
- Display all attached image of every post of custom post type and link to original post
- Custom Taxonomy Breaks Pages
- 2 queries with counters
- How to set parameters for search loop?
- WP_query problem -spurious results
- Get query results with a page title
- How do I add an item to the WP admin menu?
- Get posts with no tags?
- Multiple meta query from array
- Avoid duplicate while merging two query post
- Meta query with compare by more than 2 fields
- Query by key or author