I can’t figure how to get the ID of the custom taxonomy I’m using to loop through the custom post type called “test_values”.
function prefix_load_term_posts () {
$term_slug = $_POST[ 'term' ];
$args = array (
'post_type' => 'test_values',
'posts_per_page' => 1,
'tax_query' => array(
array(
'taxonomy' => 'test_value_category',
'field' => 'slug',
'terms' => $term_slug ,
),
),
);
global $post;
$myposts = get_posts( $args );
ob_start ();
foreach( $myposts as $post ) : setup_postdata($post); ?>
<?php endforeach; ?>
Anyone have any suggestions how to get this taxonomy ID within the loop?