You can get every Taxonomy by
$categories = get_the_terms( get_the_id(), $taxonomy-slug );
if ( is_array( $categories ) ) {
foreach ( $categories as $category ) {
echo '<a href="' . get_term_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a> ';
}
}
Just fill in the slug of your custom taxanomy, and you are good to go.
If you just want to output the first Name, make a break
after the echo
.
get_the_terms()
returns an Array of Taxonomyobjects, and you can easily output the first one.
Related Posts:
- How can I select a primary category?
- Display empty taxonomy terms with get_terms()
- Get WooCommerce product category list in functions.php
- Display List of Categories Within a Custom Taxonomy
- Is There a Difference Between Taxonomies and Categories?
- Check if a post is in any child category of a parent category
- How to export and import taxonomies (category, tag and/or custom taxonomy) and their terms
- get_categories for custom post type with a specific custom taxonomy attached
- Order get_terms() By Custom Field
- Control term order on a per-post basis
- How can I add the featured image functionality to a custom taxonomy?
- Combine two taxonomies in a hierarchical tree
- How to make custom taxonomy check boxes like ‘Categories’
- Are Categories, Tags and Custom Taxonomies any different in regards to SEO?
- How to create non-unique sub-category slugs?
- How to get next previous category in same taxonomy?
- Does WordPress Offer a Way to Find All of the Categories that Don’t Have Children?
- Add custom taxonomy terms to WordPress menu dynamically & append #slug to url
- Removed slug from CPT, now How/where do I hook the filter to the taxonomy term archive pages link?
- Getting WordPress custom taxonomy/category?
- Get a list of Terms for a specific category
- How to get the number of child categories a specific parent category has?
- How can I convert some categories to a custom taxonomy?
- Get multidimensional array that reflects category hierarchy
- List Terms in Category
- display taxonomy slug from term ID
- Limit number of terms that a custom taxonomy can save per custom post type
- Change existing taxonomy settings when using custom taxonomy
- Display Taxonomy Terms in an option tag with value being the slug
- How to get the id from the custom category?
- How can i insert term in a specific language of Polylang?
- Why does the argument list_only do on Walker_Category_Checklist::start_el?
- Display Posts Loop for each parent and for each Child
- Is There a Difference Between Taxonomies and Categories?
- How can I edit the ‘Most Used’ tab in the categories meta-box to show another custom taxonomy?
- Get posts from specific taxonomy term
- Get posts under a category with SQL
- get_terms function not returning anything
- Ive got a term (get_term_by) but now I want to filter it by a category it is in?
- Question on using custom structures for categories
- Get Categories Where Taxonomy Equals ‘n’
- Display sibling categories on category page
- Echo text using is_tag
- Same menu for different taxonomies to reach different content
- Showing HTML if Post is In Certain Taxonomy Term
- How could I write a get_categories_by_year() function?
- Post to inherit custom category background image from parent
- How to get posts using category slug in ClassiPress?
- Combining these queries? (Same taxonomy term + same category as post)
- List taxonomy terms assigned to a post in hierarchical view
- How to set the same base url for two different taxonomies?
- Ordering terms whilst in loop
- outputting taxonomy hierarchy
- Why use hierarchical taxonomies instead of many custom taxonomies?
- Renaming default category taxonomy?
- How to Manage and link certain custom taxonomy?
- How to add a post with new Taxonomy without assigning to default category?
- List Terms by category
- get_adjacent_post_link excluded_terms ignored
- Why is my post categories not displaying?
- Problem importing categories and sub-categories
- Converting Categories (with ACF fields) to custom taxonomies
- Taxonomy term RestApi data 10 rows limitions
- hide_empty property not working when using get_terms
- How can I get the categories and subcategories separately?
- When using get_terms with hide_empty = true, terms that only contain scheduled posts are not returned. How to override this?
- get_term returns different results, sometimes empty, sometime the correct list
- How can I change the output display of my pagination?
- Exclude product attributes from taxonomy terms loop
- Grandchild Term Things Grandfather Term is It’s Parent
- Corrupted nav-menu?
- Get name of taxonomies of current page
- Eliminate word from $term->name
- What Must to Display the “mysite.com/category” URL?
- Custom page category taxonomy 404
- WP 4.7 in_category change?
- List Top 5 taxonomy terms based on number of post
- set terms to category and subcategory
- Get posts of a custom post type from category from taxonomy?
- Filter By Category Dropdown List With Custom Taxonomies
- query_posts by category_name and custom taxonomy
- How to get posts by category and by choosing a taxonomy term?
- Getting Category Children
- Is it possible to create an alias/custom taxonomy for a category name?
- Illegal string offset ‘taxonomy’ in
- Style a category from category list
- Custom Taxonomy Terms in Menu lead to which page?
- More efficient way to list posts by category [duplicate]
- Change categories count to include media attachments
- How to schedule categories?
- How to get selected taxonomy or category ID if using custom walker?
- I need to exclude from a query a category and a few custom taxonomies
- Exclude categories by ID
- Let user select their own category
- Get terms for a specfic post from multiple taxonomies in custom post type
- Using in ‘category_name’ in ‘$query->set();’?
- Copy post taxonomy?
- How to store category and tags separatly on wordpress?
- WordPress custom taxonomy
- Category link redirect to custom template page instead of index.php?