Fastest way to do meta query when I don’t need the actual posts, and just need post_id?
Fastest way to do meta query when I don’t need the actual posts, and just need post_id?
Fastest way to do meta query when I don’t need the actual posts, and just need post_id?
I solved it by creating 2 different wp query and then merging them. I also excluded the post ids of 1st query in 2 query to avoid duplicate items.
Overwrite YoastSEO meta-tags with another page’s [closed]
I already got it. Was missing an extra array() in the meta_query. My updated code is this: I’d like to thank this website. Sometimes just posting the question helps me figure it out. What a cool community. Good luck and happy coding, all. <?php $artist_id = get_the_ID(); $want_to_sell = new WP_Query( array( ‘post_type’ => ‘want-to-sell-post’, … Read more
Meta query for custom post type ignored in main query
If you want all posts that have ReleasedProject AND PermanentArtist both set to true, you need to change the value keys for both of those to ‘true’. If you want to exclude all posts that have both of those set to ‘false’, you need to add ‘compare’ => ‘!=’ to both meta query arrays. EDIT … Read more
I’m assuming you’ve used the method in the question linked to and are using the restrict_manage_posts filter. add_action( ‘restrict_manage_posts’, ‘my_search_box’ ); function my_search_box() { // only add search box on desired custom post_type listings global $typenow; if ($typenow == ‘product’) { //On custom post type ‘product’ admin page. //Add code for search box here } … Read more
You’ll probably need to do one of the following ‘compare’ => ‘=’ (or leave it out, as it’s the default) or… ‘value’ => $wpdb->esc_like( ‘%Boys%’ ) (needs global $wpdb;) or… ‘value’ => $wpdb->esc_like( ‘Boys’ ) (needs global $wpdb;)
I don’t think you’ll be able to do this in a single query – what you seem to need is multiple relationships between conditions, and as it works currently, meta_query doesn’t let you do that. I googled it a bit and found others saying it doesn’t, but I also went into the core code and … Read more
You can’t, at least not efficiently. You best bet is to use the LIKE statement, but it would fail for searches like “title”, “link”, “mp3” 🙂 I suggest you build your own serialization method. For example, store the tracklist as a string like this: Track1 title Track2 title Notice the new line character (\n). Use … Read more