You can post the terms by using wp_get_object_terms
$terms = wp_get_object_terms($post->ID, 'departments');
if(!empty($terms)){
foreach($terms as $term){
$exampleName = $term->name;
$exampleSlugs[] = $term->slug;
}
}
Alternatively you can try to first ensure that the right taxonomy is being used:
$taxonomies = get_taxonomies();
echo '<pre>';
print_r($taxonomies);
echo '</pre>';
If everything is allright you’ll see an array with all the taxonomies, and the taxonomy “departments” is present in this array.
When you want to output all the terms you can then use this:
echo '<pre>';
$departments = get_terms( 'departments', 'orderby=count&hide_empty=0' );
print_r($departments);
echo '</pre>';
Then you can use it anyway you want.
Related Posts:
- Exclude a term of a taxonomy with a custom post type in a search
- How to display product subcategories into my custom post type single page
- Get post from custom post type order by two taxonomies
- WooCommerce – Custom related product (Spareparts)
- Custom Taxonomy not working front side Woocommerce
- Custom Taxonomy is disabled on Edit page
- Complex strcuture as CPT or taxonomy for use in woocommerce product variations [closed]
- How to manage a bookstore
- Issue On Listing Woocommerce Parent Tag List
- Shouldn’t this be easy?! Custom post type/custom taxonomy permalink
- Combining Multiple Taxonomies in one URL
- Getting the Intersection of Two Custom Taxonomy Terms for a Custom Post Type?
- Why does my custom taxonomy show a total count across all post types
- How can I list all the categories under a Custom Post Type (taxonomy)?
- ‘No pages found’ in Dashboard after registering custom taxonomy
- Custom Post Type with Nested Taxonomy and Template Files
- How to display recent posts added in custom post types
- Should unaltered default loop/query return a list of custom posts belonging to a custom taxonomy?
- Creating a function that receives the taxonomy terms that have been changed in a custom post type
- Query for posts in 2 taxonomies
- Permalinks when filtering multiple custom post types by single taxonomy
- Filter custom post type archive page with custom taxonomies (categories) with AJAX
- How can I filter by taxonomy on a custom post type’s page?
- Can custom taxonomies items have attached properties?
- How to Get Current Custom Post Type Selected Taxonomy Term (Not All Terms)
- Custom Taxonomy URL are redirecting to page with the same name
- Custom Post hierarchical to custom taxonomy
- Loop custom taxonomy to get lists of cutom post types?
- Hierarchical Custom Post Types in Array
- Making certain categories of CPT not publicly queryable
- Conditional Query of Custom Post Type and custom taxonomy
- Is $object_type truly required with register_taxonomy()?
- Show a Category X’s custom post type on Category X archive page?
- custom-taxonomy/post_name instead of the default post_type/post_name
- Specific query for custom post type
- Custom taxonomies relationship
- Suggested Post and Taxonomy structure
- Display post content with respect to its title?
- Use custom walker to add taxonomy terms to main nav menu
- WP_Query orderby and tax_query
- Custom Taxonomy not being saved on custom posttype
- Get parent category id from child category page for custom taxonomy
- Trying to get custom post of a custom taxonomy
- Creating custom post type with custom taxonomy and custom fields programatically
- How to get only child terms from a custom taxonomy of current post type?
- How can I create an automatic drop down menu with my tags?
- How to see posts in taxonomy endpoint
- Get taxonomy singular name instead of taxonomy slug inside $taxonomy query
- sort CPT on Custom Taxonomy Archive page
- Add term slug in URL of custom post type details page
- Cannot choose custom categories for custom post type in post editor
- Custom post type and custom taxonomy 404 on page 2
- Ideas on how to organize a project [closed]
- Arduous WordPress Custom Post Type Permalink Path
- Modifying rewrite rules to use /category//
- Custom Post Type URL Rewrite’s
- Add term for custom taxonomy from front end
- Custom Taxonomy Filter Issues
- how to organize my categories or should I do custom post types for some?
- How do i display post from a taxonomy term?
- Multiple permalinks for a single post with multiple taxonomies
- rewrite rules hierarchical
- Auto Generate Post Title from 2 Custom Fields
- How do I make a request in my browser to search the CPT taxonomy?
- Archive page of taxonomy returns a 404 error
- Custom Post type to Woocommerce Product type
- Get dropdown child categories from parent category of custom post type
- How do you create pillar content pages?
- How to display “META” array in register_taxonomy
- I want to create a metabox under custom taxonomy
- Grid slider with custom post type (how to filter with taxonomies?)
- Customise Permalink Structure For Custom Post Types
- CPT/Taxonomy/Postname permalink structure makes pagination break
- Set different posts_per_page for custom post type/taxonomy
- WooCommerce breadcrumb display custom posts instead of product data
- Facing some Issues on Two Parts Custom Post Type Taxonomy Names
- I want to create an archive and single page for a custom taxonomy for a custom post type
- Taxonomy’s title
- Display all posts from single taxonomy term
- Creating adminable dynamic filtering on custom post type
- Best way to use Category & Custom Fields?
- WP_Query for CPT with filter by another WP_Query
- Get posts in same category not working
- Heirarchical URLs with CPT and custom taxonomy
- Displaying taxonomies with manage_{custom-post-type}_posts_custom_column
- Plugin Error on activating
- Permalinks when using Custom Post Type with static page for archive
- How to change permalinks to taxonomy and post type’s posts
- Paginate custom taxonomy category with wp_custom_pagination
- Parent cpt/child custom post type URL permalink relationship
- Query Only Show Text on Posts With Certain Taxonomy Tag
- Custom Taxonomy Showing in WP Menu
- Storing/querying custom date data
- Custom Template Taxonomy
- How to relate one custom post type to another custom post type
- How to make a single Menu Item call another Mega Menu for Custom Post Types and Custom Taxonomies?
- Links in archive not including taxonomy parameter
- Limit taxonomy terms added to a custom post type
- I want to understand plugin implementation of custom posts / taxonomies / metaboxes
- Dynamically count the number of custom post types associated to a custom taxonomy