Get a list of Terms for a specific category

The following code will do it. Please change the ‘filter’ text in the below code to whatever filters taxonomy name you have set. if(is_category() ){ $thiscat = get_queried_object_id(); $filter_tax = array(); $args = array( ‘category’ => $thiscat ); $lastposts = get_posts( $args ); foreach ( $lastposts as $post ){ setup_postdata( $post ); $terms = get_the_terms( … Read more

Display custom taxonomy as dropdown list

Below is the easiest solution I use for displaying custom taxonomy as the dropdown instead of checkboxes. 1/ Use third party WordPress plugin ‘ACF’ to create the taxonomy ‘Relational’ field type and display it as dropdown as shown in below screenshot. https://wordpress.org/plugins/advanced-custom-fields/ For displaying taxonomy selected you can refer documentation of ACF for relational taxonomy … Read more

Custom taxonomies

You can use get_the_terms( int|WP_Post $post, string $taxonomy ) . See Codex detail here. $my_terms = get_the_terms( get_the_id(), ‘regionen’ ); if ( ! empty( $my_terms ) ) { if ( ! is_wp_error( $my_terms ) ) { echo ‘<ul>’; foreach( $my_terms as $term ) { if($term->parent == 0){ echo ‘<li><a href=”‘ . get_term_link( $term->slug, ‘regionen’ ) … Read more