I would check the output of $querystr
. It looks like you have the table name twice. $wpdb->postmeta
resolves to something like wp_postmeta
and then you have postmeta
again. This gives you wp_postmetapostmeta
which isn’t a valid table.
I highly recommend you try out Debug Bar. It greatly simplifies query debugging.
Related Posts:
- Is it possible to create a shortcode that will query a post based on taxonomies?
- Shortcode to return single custom post based on post taxonomy
- Shortcode with loop stacks output
- Where to put my code: plugin or functions.php?
- Pagination not working with custom loop
- Get the ID of the latest post
- Create a shortcode to display custom post types with a specific taxonomy
- Sort custom post type list table by display name of a user id stored as post meta value
- How to use a custom post type as front page?
- Random post, once per day
- get attachments for all posts of particular post type
- Display custom post type with shortcode
- Add Content to Page without shortcodes
- Query custom post type by custom field
- Add Custom Post Type to Current Query
- Custom Queries: Joining On Meta Values From Two Custom Post Types
- How can I fix those issues generated by the Themecheck plugin
- Shortcode Displaying Custom Post Types
- WordPress Custom Shortcode Conflicting with Media Library
- SQL to update custom post taxonomies
- Query multiple taxonomy in Custom Post Type
- Querying Posts by Taxonomy From Alternate Network Site
- Custom Search | Wrong output & question
- Get the most popular terms for a custom post type
- Query by 2 values of a repeater ACF field
- show posts only on homepage but using custom post type and taxonomy for query posts via url
- Comparing timestamps in meta query doesn’t work
- Display two post types ordered by two custom fields
- WP insert post PHP function dynamically generated Custom Fields
- Include both default and Custom Post Type in query modified inside pre_get_posts
- Query posts between two dates (custom meta keys) CMB2
- $wpdb returns no results with SELECT query on custom post type, works on default post type
- Include different loop templates in search query
- Adding posts of custom type into the main feed
- Custom Post Types, Page Templates and Pagination. Why do I get a 404 Error?
- Inserting data into `post meta` table?
- Using shortcodes to parse POST request (containing the data from a front-end form)
- How can i list custom post type categories?
- Automatically adding meta data to posts or multiple query help
- IF statement in a do_shortcode
- Having trouble with custom date field for CPT query (WordPress)
- Post the content of a specific “Custom Post Type” post within a post using a shortcode
- Strip shortcode from specific post types (formats)
- Custom Post Type order by modified date and custom meta field issue
- Pagination in a Shortcode. Get_next_posts_link not working but get_previous_posts_link works fine right next to it
- Sort posts based on multiple custom fields
- WP_Query search posts by custom post type and custom taxonomy
- Why does using WP_Query inside a shortcode in an elementor page cause the arguments for WP_Query to get malformed?
- Calculating Bayesian average for custom post type
- Conditional to modify query results
- Generate Shortcodes by Taxonomy
- How would I create a shortcode to display a custom post within a page or regular post?
- Selecting New & Edit Page for Custom Post Types
- Show Two custom Post type and their posts on category page
- How to filter custom taxonomy categories on archive?
- WP_Query is printing out only one post when posts_per_page is set to multiple
- Modifying date filter on admin page for custom post type to link to custom field
- Ignore sticky posts if post is not in meta query
- Get custom posts with certain ids in a custom loop using a shortcode
- Querying Term Posts in Loop
- How to debug a blank page?
- query posts and custom post type with meta key
- Use get_post_types to query only custom posts types
- WordPress Orderby Numeric Value Not Working
- Custom Post Type Loop within Shortcode
- Shortcode insertion in tab
- Query string parameters from custom fields, inconsistent results
- Shortcode doesn’t display in custom post type
- Custom Post type is being ignored in query
- Query custom post type only if it contains another custom post type
- Add category attribute to custom shortcode
- Add post_type to index.php
- How to display Custom Post Type Post based on Tag with Shortcode Parameter?
- Order By Post Type ThenBy Taxonomy
- Custom query to filter posts that have current post as a taxonomy [closed]
- How to create shortcode to display custom field value on a custom post type
- How to enable shortcodes in a custom post type?
- Get custom fields from a custom post type with a shortcode
- Shortcode for display posts in wp-editor
- Display Recently Added Custom Post Types with Custom Taxonomy Shortcode
- Am unable to reset a query properly
- Custom post type redirected to homepage – how to debug
- How to modify archive query with pre_get_posts to append CPTs?
- Get next and previous 3 posts in a term in single post page
- convert custom query to wp_query
- Get custom post type list for every category shortcode
- Making certain categories of CPT not publicly queryable
- Search / Filter posts on Title/Content OR Tags
- Get parse_query filter to return slug instead of id
- Querying both pages and posts
- Meta query for custom post type ignored in main query
- Querying Two Custom Post Types with OR Not Working
- How do I move/order posts with a tag to the end?
- creat filter with wp_query
- Specific query for custom post type
- Using advanced custom fields from one custom post type in another custom post type / using nested shortcodes
- How to render a custom post type template with custom fields using shortcode
- Form action/link to render a plugin in WordPress front-end
- custom post type category count shortcode
- Display Child Pages of Custom Post Type Parent Page