Thursday, June 14th, 2018
This will go in taxnonomy.php or taxonomy-name.php templates.
$term = get_term_by( 'slug', get_query_var('term'), get_query_var('taxonomy') );
$customField = get_field('custom_field_name')];
$args = array(
'posts_per_page' => '-1',
'post_type' => 'service_centres',
'tax_query' => array (
array (
'taxonomy' => 'regions',
'field' => 'slug',
'terms' => $term->slug
)
),
'meta_key' => 'custom_field_name',
'meta_value' => 'custom_field_value_value'
);
Tags: PHP, Query, Taxonomy, Term, Terms, WordPress
Posted in PHP, WordPress | No Comments »
Thursday, December 1st, 2016
$queried_object = get_queried_object();
$taxonomy = $queried_object->taxonomy;
$term_id = $queried_object->term_id;
the_field('custom_field_name', $queried_object);
Tags: Custom tax, Custom taxonomy, ID, Slug, Taxonomy, Term, WordPress
Posted in PHP, WordPress | No Comments »
Thursday, August 18th, 2016
Tags: Functions, Name, Query, Tax, Taxonomy, Term, Terms, WordPress
Posted in PHP, WordPress | No Comments »