Any quicker alternative for WP_Query “NOT IN”
Any quicker alternative for WP_Query “NOT IN”
Any quicker alternative for WP_Query “NOT IN”
You have ‘orderby’ => ‘menu_order’, ‘order’ => ‘ASC’, these lines define the order of the posts. ‘terms’ => $term_array it’s only define posts that have taxonomy with these is, the order doesn’t matter.
Hi need update in my terms for other taxonomy
Custom Query: Multiple CPTs and a taxonomy filter
“Menu order” being ignored when querying posts from a parent taxonomy with “include_children” set to true
You haven’t specified the ‘field’ value e.g. ‘field’ => ‘slug’, http://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters
Answering myself, the problem was the ‘AND’, must be ‘OR’, thank you anyway.
You aren’t looping through the results. Here is your code: $m = new WP_Query( $myquery ); if ( $m->have_posts() ) : $m->the_post();?> <ul><li <?php post_class();?>><a href=”https://wordpress.stackexchange.com/questions/83409/<?php the_permalink(); ?>”><?php the_title(); ?></a></li></ul> <?php endif; wp_reset_postdata(); ?> There is no Loop. You just check for the existence of posts, echo some information about the first one and quit. … Read more
I found a solution to this myself. It returns the default post type posts instead of excluding the custom post type which is fine for my needs. function my_breakfast_query ( $query ) { // not an admin page and is the main query if (!is_admin() && $query->is_main_query()){ if (is_tax( ‘food’, ‘breakfast’ )){ $tax_query = array( … Read more
Change your code with the following: $args = array( ‘post_type’ => ‘property’, ‘posts_per_page’ => 5000, ); $statuses = explode( ‘,’, $st_term_final_string); $terms = explode( ‘,’, $il_term_final_string ); if ( $statuses || $terms ) { $args[‘tax_query’] = array(); if ( $statuses ) { $args[‘tax_query’][] = array( ‘taxonomy’ => ‘Status’, ‘field’ => ‘slug’, ‘terms’ => $statuses ); … Read more