Exclude taxonomy term from list of current taxonomy terms
Exclude taxonomy term from list of current taxonomy terms
Exclude taxonomy term from list of current taxonomy terms
The terms for the tax_query should be an array.
Nothing stands out as ‘wrong’ – though you do have a few errors: The third tax_query conditional is missing a closing bracket The third tax_query should be querying precio not $ubicacion. Cast the ID variables as integers I’d suggest putting WordPress into debug mode to highlight any syntax errors. Try doing it for only one … Read more
setup_postdata will let you use loop functions with post results via get_posts. another option is to use the various filters available to alter WP_Query‘s behavior- posts_join, posts_where, posts_orderby.
So I went ahead and did the multiple loop thing, as I had done before. I’m always interested in seemingly cleaner/simpler solutions, but sometimes you just have to keep moving. This is the code I’m using: <?php $args = array( ‘post_type’ => ‘projects’, ‘project_category’ => ‘websites’, ‘orderby’ => ‘menu_order’, ‘showposts’ => 1 ); $posts = … Read more
I may suggest not combining each of these into hierarchical taxonomies, but setting up 3 distinct taxonomies. It seems like they are 3 unrelated properties of the photos, and thus, I would separate the code for them. Then you’re not trying to code around nested taxonomy terms, but you can access them each individually. The … Read more
when you register a taxonomy, the second argument is the post type it is available for: register_taxonomy( $taxonomy, $object_type, $args ); if you want the taxonomy to work for a custom type as well as standard posts, you can pass an array of types: $object_type = array( ‘your_custom_type’, ‘post’ ); alternately, you can use register_taxonomy_for_object_type: … Read more
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
You should have a look at this answer. Group by isn’t what you want. WordPress, by default, groups by post ID to eliminate duplicate posts from the list. Since you’ll need to group by ID and post_type, there will always be only a single combination of post_type and ID (your group by will do nothing, … Read more
You’ve converted $taxonomy_id_list to a comma separated string then shoved that string into an array. Your array now looks like array( “1,2,3,4” ); That is not going to match any author ID. You are misunderstanding what implode does. This–1,2,3,4,5,6,7— is a set of integers. If place in the array like this– array(1,2,3,4,5,6,7)— you get an … Read more