Query posts filter not working
Query posts filter not working
Query posts filter not working
you can do this using the plugin “Advanced Custom Fields”, just create a field type “post object” and them associate this field with the “Work” custom post. Later in your template, you can get the artist data, a object with all elements by your custom post named Talent. Advanced Custom Fields have a great documentation … Read more
There are a few things wrong: In your code you are using the same $args array in the WP_Query call that you used in your get_terms call. Perhaps you meant to use $postargs in the WP_Query call? @Milo is correct…you should be using posts_per_page, not number. Your tax_query array element ‘field’ says ‘name’ but you … Read more
Not sure why you would try this with taxonomy. I would suggest making a meta_key “country” with the values. Then you can query it like in the documentation: $user_query = new WP_User_Query( array( ‘meta_key’ => ‘country’, ‘meta_value’ => ‘Israel’ ) ); Not sure why your taxonomy-query doesnt work, looks fine also, i use it like … Read more
The Smarter Navigation plugin by scribu has solved this need for me: https://wordpress.org/plugins/smarter-navigation/ Not completely perfect but recognises which taxonomy term is being used and provides appropriate links.
WP_Query on “property” in the options table
@Milo found that the problem was with the code to order by the track number taxonomy. I’m going to make track number a custom field.
For the record I found an answer to this question in the end – I needed to use a meta query rather than a taxonomy query. The correct code ended up being this: $relatedBlogPostArgs = array( ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => 1, ‘order’ => ‘DESC’, ‘orderby’ => ‘date’, ‘meta_query’ => array( array( … Read more
You can get the Packages of the current Proposal using wp_get_object_terms() and then pass some/all of those into a WP_Query. $terms = wp_get_object_terms( $post_id, ‘packages’, array( ‘fields’ => ‘ids’ ) ); $args = array( ‘post_type’ => ‘proposals’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘packages’, ‘terms’ => $terms ) ), ); $related = new WP_Query( $args … Read more
While I can’t guarentee that this is what you are looking for (as you have not posted what your expected output should be), hopefully this will help. Even if it’s not exactly what you are looking for, you have the whole object for each term available to you so that you can manipulate the output … Read more