You have a problem with the tax_query arrays
array(
'post_type' => 'attorneys',
'tax_query' => array(
'taxonomy' => 'practice-areas',
'field' => 'slug',
'terms' => 'appeals',
)
)
The tax_query
parameter in $loop
must look like this:
$loop = new WP_Query(
array(
'post_type' => 'attorneys',
'tax_query' => array(
array(
'taxonomy' => 'practice-areas',
'field' => 'term_id',
'terms' => 'appeals',
)
)
)
);
The tax_query
parameter must be an array of array and the field
parameter slug (as terms is not the term_id).
Important Note: tax_query takes an array of tax query arguments arrays (it takes an array of arrays). This construct allows you to query multiple taxonomies by using the relation parameter in the first (outer) array to describe the boolean relationship between the taxonomy arrays.
You can read more about the parameters available and their default values Codex WP_Query
Hope it works!