if i understand correctly you want to get a list of albums
(posts) of a specific artist(taxonomy) and that are have ihaveit
term.
if so the its a simple query using tax_query
:
$args = array(
'posts_per_page' => -1, //get all
'post_type' => 'album',
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'artist',
'field' => 'slug',
'terms' => array( 'artist-slug' )
),
array(
'taxonomy' => 'whereisit',
'field' => 'slug',
'terms' => array('ihaveit')
)
)
);
$query = new WP_Query( $args );
while($query->have_posts())
{
$query->the_post();
//to your thing / loop here
}
Related Posts:
- Where is the proper place to add a filter for pre_get_table_charset?
- Restrict filter to run only inside specific function
- How to Get All Taxonomies AND All Terms For Each Taxonomy With Post Count Zero
- Change term name only on front
- Insert term when page is published – avoid duplicates after edits
- Get .subsubsub count of post per status queried using pre_get_posts
- Adaptive product filters for WooCommerce
- Create Search Form to Filter Through Terms
- Run posts_where and posts_join only on the main query
- Create a pre-filtered version of the Media Library
- Filter authors on meta value
- How to query if meta_key does exist or not?
- How to stop the deduction in “wp_term_taxonomy” count, when the post is deleted?
- Customising the default wordpress search functionality
- Display post after choice two taxonomy terms
- Adding an orderby filter, casting postmeta with multiple keys
- How to filter users on admin users page by custom meta field?
- Modify WordPress Rest Api Request/Response
- How to add some custom HTML into wordpress admin bar?
- What params are available with the_content filter?
- Hook into admin post list page
- Add post/page ID to inserted links within the_content
- How to exclude/filter a tag from get_the_tag_list()
- Ajax, filters and shortcodes
- Filter the blog’s title without using global variables
- Multiple Ajax Data Action
- user_has_cap filter allows edit but will not allow save
- Hook different functions to the same filter conditionally OR Pass additional arguments to existing filter?
- Changing a WordPress core function without hacking core
- How to remove get_post_metadata using remove_filter inside a class?
- where to apply “apply filters” and other Sanitization Functions
- Add guid filter to attachment in media library grid mode
- Pass parameter to the upload_dir filter
- Sorting and limitation with pre_get_posts
- Warning: Missing argument 2 for widget_title filter
- How do I hide the current page’s title?
- Change name of existing post status type
- add_filter(‘the_content’, ‘…’) stops pagination from working
- How can I exclude tags from category_rss function?
- using $wpdb to get custom post type with term
- Header image automatically changes depending on season
- How to remove SKU’s from ALL products in Quick View – already remove from each product page
- How do I use remove_action on an add_action that uses an array?
- Change the default 10-day expiration for the password protected pages cookie
- How can I change the language of automated Mails?
- Query most popular terms by taxonomy over 2 week period
- How can I replace an oEmbed URL in post with actual embed HTML
- Replacing a deprecated filter ‘woocommerce_get_price’ with ‘woocommerce_product_get_price’
- How do you get specific tags from the_content?
- Add a filter inside an action init
- Is it possible to apply_filter on a wp_ajax_ action?
- Apply filters with multiple filters
- Filter by category and city for doctors and hospitals in wordpress
- Using add_filter to prepend content, result is out of order
- Why is overwriting $GLOBALS killing the_content()?
- Sorting products by price ( regular + sale price )
- get_posts() interrupt because of filter
- Remove comments validation (remove filter?)
- Disable sanitize_file_name on upload without modifying functions.php
- Remove Site Name from wp_title WITHOUT removing from attribute
- Plugin default settings hook
- add_filter to the_content after apply_filters
- Best practice: Custom Post Type / Filter / Load more
- How to Edit Ecommerce filters URL, h1, h2 , Title
- Filter Media by attached page or blog post in Library
- How to stop DOMDocument destroying embeds?
- How to modify image caption in posts?
- Extend Nonce Lifetime for Specific Nonce Creation
- Get custom taxonomy terms that contain posts that have another taxonomy term
- AJAX Post Filter
- Mystery line break
- Consult array data in REST API Filter
- How to add markup to the wp-custom-header div
- How to stop echoing gallery inside content?
- Having issue with dynamic data within restrict_manage_posts function
- how to filter datalist table of wordpress
- Ajax Filtering Pagination
- Custom permalink for attachment
- Overriding Generated Attachment Post URL
- Pagination while keeping the filters
- Is there a function to edit Blogs contents in Blogs page?
- Filter on the day of the week from timestamp
- using filters on the function from class
- how it’s possible to show from a post of a custom post type the taxonomy/terms?
- Put data in my-account/view-order/id/ page
- Can’t set properly WordPress add_filter function
- Hook inside a hook
- Filter WordPress Archive Widget to exclude posts with specific custom taxonomy term id
- Password protected Page add_filter to change the text doesn’t work
- How to filter content in Dashboard?
- How to remove a filter that is an anonymous object?
- add_filter not adding the filter
- Add class to all parent elements inside the_content
- Is this correct usage of filters in WordPress [closed]
- Date filter for post query not filtering results when variable outside the function
- Passing variable from filter
- Filter and Search
- Getting entry ID from frm_email_message filter in formidable
- Is there a hook or filter that adds a button to the left of the search box?
- Filter and manipulate the get_current_user() function