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' ) . '">' . esc_html( $term->name ) . '</a></li>';
}
}
echo '</ul>';
}
}
Related Posts:
- get_term_children for immediate children only (not grandchildren)
- Custom taxonomies capabilities
- Can’t get a custom template taxonomy page to display
- Display category posts grouped by taxonomy
- Creating a non-removable taxonomy term
- Can I turn off write-in tags/taxonomies?
- get_query_var(‘paged’) always returns empty
- Return only the custom sub-term for custom post type, do not echo term-parent
- Using tax_query creates a 1 = 0 or 1 = 1 in $wp_query->request
- Displaying the Name of the Queried Taxonomy Term on a Term Archive Page?
- How can I set a default listing order on the admin page for a custom taxonomy? (without plugins)
- Post tags saving as both tag name & tag ID on post update when tags are displayed as checkboxes
- Retrieving custom taxonomy in order, but excluding specific tax IDs
- get taxonomy terms for parent and child
- On Taxonomy Template page, want to add Post_Type
- Taxonomy query for children of parents
- Help building array hierarchically with taxonomies (to get posts)
- Removing the base “Author” or changing it to something else. is it possible?
- how to get title to custom tags page
- Display sub-taxonomies based on SELECTED parent-taxonomy
- How to handle “the_terms” inside loop
- How to create drop down for child categories of current taxonomy being viewed?
- How to dynamically add custom taxonomy terms as a sub-menu of an existing menu item, using custom walker class
- Get terms ordered by post date
- Custom Taxonomy list: how to make “choose from most used” default to open, checklist
- How to register child taxonomies?
- custom post type, hide or disable the trash button in publish meta box
- Display hierarchical subterms of custom taxonomy based on depth
- Date archive permalinks for custom taxonomy
- Custom Taxonomies Cababilities
- How do I display a list of posts under all hierarchical children of the current taxonomy?
- Use get_the_terms to list subcategories of custom taxonomy
- Get posts from taxonomy URL
- How to implement custom search with input fields?
- How can I hide admin columns showing extra custom taxonomy fields?
- Manipulate WP Query using a custom post type and multiple tax_query taxonomies
- How to create a dependent drop-down and options in dropdown must be manageable from admin panel
- Filtering posts by an already registered taxonomy
- How to filter a post in the Tag Cloud widget, using tags of a media library image attached to the post?
- How to separate posts in loop?
- Custom Taxonomy isn’t working from frontend post submitting
- Term and sub term from custom post type query [closed]
- Base permalink for custom taxonomy
- put custom taxonomy slug in front of their respective term slugs
- Add success message to category add screen
- Rewrite rules for varying nested terms of custom taxonomy
- Copying taxonomy term to custom field
- How can I unregister a custom taxonomy?
- Prevent users from adding taxonomy terms
- Count Number of Posts in Taxonomy Term in Last 24 Hours
- Problem with removing post tags programmatically
- Query custom taxonomy by term id?
- Update table wp_term_taxonomy.count after INSERT INTO via SQL
- Get posts in certain Taxonomy terms for the current page url
- How can I reduce amount of ifs and else ifs in this specific block of code?
- Get all attachments by custom taxonomy – term
- Get terms that don’t belong to current post with a shortcode
- Correctly order the hierarchy of custom taxonomy when displaying terms
- {$taxonomy}_edit_form_fields not working
- How best to store data (URLs and IDs) extracted from posts and pages using custom taxonomies
- Custom taxonomy link automatically removing query string and re-directing
- Custom taxonomy filter for media
- export and import taxonomy terms from one taxonomy to another
- How to create a custom template for custom taxonomy wp-tag-cloud?
- Find terms in a custom taxonomy based on the hirearchy
- Replace taxonomy term with an image in a custom loop
- Need to display custom taxonomy on single page – not working
- WooCommerce custom taxonomy as meta?
- Query custom taxonomy for category including children
- Only display latest custom taxonomy post
- Get 1st parent category id from post
- Filter by Custom Taxonomy AND Custom Field
- How to group non-hierarchical tags?
- Custom Permalink Structure for terms/taxonomies of custom post type
- Display custom taxanomy on woocommere product page
- Show recent posts from a custom taxonomy in wordpress
- update attribute of specific products in woocommerce
- when custom taxonomy is empty, the page won’t load
- How to structure all custom-taxonomy with three verbs(a,b,c) and route them accordingly?
- how do you pull data from two taxonomies?
- How do I show the parent term on a custom taxonomy template (not the ID)?
- register_taxonomy_for_object_type (images) : how to use it ?
- Restrict user to terms in a custom taxonomy registered for both posts and users
- WordPress search form and search result through ACF field in custom taxonomy
- Exporting Custom Taxonomy Description without Plugin
- How to show selected check box vendors on front end home page?
- WordPress tag or archive php file customization
- Dynamic value for get_option linked to taxonomy term_id?
- Best Method to Switch Between Terms (Custom Taxonomy)
- custom taxonomy don’t return a value
- If page is a taxonomy do X, if is a term, do Y
- Getting the parent terms adds additional empty markup [closed]
- Where to put a migration script to switch post information?
- Custom taxonomy list in two columns
- get multiple values from $_GET from multiple checkboxes
- Get post terms with hierarchical relationships
- Using wp_query is it possible to orderby taxonomy?
- Way to organize content – custom taxonomies or other way?
- Using post type archive page for taxonomy archive
- Taxonomy archive link from term id