How to search CPTs in draft using get_page_by_title()
You could try this: $args = array(“post_type” => “mytype”, “s” => $title, ‘post_status => array(‘draft’)); $posts = get_posts( $args );
You could try this: $args = array(“post_type” => “mytype”, “s” => $title, ‘post_status => array(‘draft’)); $posts = get_posts( $args );
Slow wp_posts and wp_postmeta query using Advance Custom Fields
If posts are restricted to a specific role users are required to have, you must add some piece of metadata to the post. Else, WP won’t know which posts you mean. There’s a standard box for adding metadata to your post (select ‘custom fields’ under ‘screen option’ in your edit screen), or you could create … Read more
Tax_Query not working – connecting to second wordpress database
Try an expanded query as your current query is relying on the slug of the tag. $args = array( ‘posts_per_page’ => -1, //get all posts ‘post_type’ => ‘post’, //assuming your are not using a CPT ‘tax_query’ => array( array( ‘tag’ => ‘homepage’ //select your tag ), ), ); $casestudy_query = new WP_Query( $args );
To troubleshoot why “Bin” is not working, you’ll likely need to contact the plugin author. If it’s your own custom plugin/theme/code, please share above and perhaps we can be of more assistance. Another option might be to close the forum. Again you would need to contact the author to determine whether that is possible or … Read more
What you’re trying to do is a post meta query, but the root problem is you’re using post meta to group posts, which is what taxonomies are built for. Taxonomy tables are optimised and designed for these kinds of queries, post meta is not. What’s more, your query appears to be searching inside the meta … Read more
How to make a search query if not found in post table then search in postmeta table?
Is my code correct?
That player does have a colortoken which is not blue, because he has a red one. 🙂 SQL, and by extension the WP_Query system, is extremely literal. It’s selecting a set of players who have a colortoken that is not blue and a level of 12. It’s not excluding players with blue tokens, it’s just … Read more