I'm not much of a PHP dev (front-end dev, mainly) and I'm struggling with getting a custom taxonomy term to display all posts using that term.
Here's the deal. I have: 1. A custom post type (attorneys) 2. A custom taxonomy for that post type (practice-areas) 3. A specific taxonomy term (appeals)
I need to display all "attorneys" posts that use the term "appeals" from the custom taxonomy "practice-areas". This will be displayed on the index page so I need to be specific with the query.
Here's my loop as it stands now:
$loop = new WP_Query(
array(
'post_type' => 'attorneys',
'tax_query' => array(
'taxonomy' => 'practice-areas',
'field' => 'term_id',
'terms' => 'appeals',
)
)
);
if ( $loop->have_posts() ) :
while ( $loop->have_posts() ) : $loop->the_post(); ?>
// Get the content the_content;
//Blah blah blah close loop
?>