Slow wp_posts and wp_postmeta query using Advance Custom Fields
Slow wp_posts and wp_postmeta query using Advance Custom Fields
Slow wp_posts and wp_postmeta query using Advance Custom Fields
few things here: 1) Your WP_Query args doesn’t look good, the proper way of querying posts by taxonomy should be: $splash_page_args = array( ‘post_type’ => ‘page’, ‘posts_per_page’ => ‘3’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘category’, ‘field’ => ‘slug’, ‘terms’ => ‘splash-homepage’, ), ), ); 2) Is there any particular reason why you’re using foreach … Read more
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
If posts have post_format is gallery, you can get all gallaries by used: get_post_gallery_images(get_the_ID()); See more: https://pippinsplugins.com/retrieving-image-urls-of-galleries/
How to make a search query if not found in post table then search in postmeta table?
Is my code correct?