// First, get associated taxonomies of the post/object.
$object_taxonomies = get_object_taxonomies( get_post() );
// Next, get associated terms of the post/object.
$object_terms = wp_get_object_terms( get_the_ID(), $object_taxonomies );
$terms = array();
// returned object terms could be WP_Error, so check that first.
if( ! is_wp_error($object_terms) && is_array($object_terms) )
{
foreach( $object_terms as $object_term )
{
// get_term_link could return WP_Error as well, so validate
$link = get_term_link($object_term);
if( ! is_wp_error($link) ){
$terms[] = sprintf('<a href="https://wordpress.stackexchange.com/questions/180778/%s">%s</a>', $link, $object_term->name);
}
}
}
// Lastly, display
if( !empty($terms) ){
echo join(', ', $terms);
}
Related Posts:
- Insert terms for custom taxonomy on plugin activation, or each page load (init hook)
- Notice: Trying to get property ‘term_id’ of non-object
- How to remove plugin-specific custom taxonomy terms when plugin is uninstalled?
- term_exists() returning NULL on term that exists
- modify show UI of a registered taxonomy
- set a custom post type to a taxonomy term programmatically in metabox
- add_action priority and taxonomy used in plugin
- How to display custom taxonomy and terms using/creating plugin template
- If I want to create new taxonomies (e.g. Project / Documents / Etc…) is it better to create them in the theme’s functions.php or within a plugin? [duplicate]
- Autoloading & Namespaces in WordPress Plugins & Themes: Can it Work?
- How to get the path to the current theme?
- What process do you use for WordPress development? [closed]
- Why does WordPress use outdated jQuery v1.12.4?
- Inserting Taxonomy Terms During a Plugin Activation?
- What is an alternative method to the WordPress private _doing_it_wrong() function
- Where do I start from
- Check for featured image in WP_Query
- Update exisiting site to 3.5 release candidate
- Get file headers in custom file
- add_filter and remove_filter added before and after wp_query
- What is the difference between strip_tags and wp_filter_nohtml_kses?
- How to Make a Category Always Selected?
- Having Problem On Getting WP Post Gallery Images URL
- How to: get main plugin/theme file?
- add_theme_support using a plugin
- How to bundle a plugin with a theme, or vice versa
- How Can I setup WP CLI on Windows development machine running AMPPS?
- WP_LOCALIZE_SCRIPT doesn’t work
- What is the difference between these two methods of writing $ instead of jQuery in WordPress [closed]
- Modify a Free Plugin available on wordpress.org & include with my Premium Theme? [closed]
- Best choice of options/settings framework for plugin/theme development
- Is there any way to have Featured Text, as opposed to Featured Image?
- Find source of notice / warning / errors efficiently
- Problem with is_active_sidebar?
- need advice on how to do a lists using custom post types – taxonomy vs postmeta
- StackExchange clone using WordPress?
- Sharing common functionality (functions, template parts) between plugins and themes?
- Change template dynamically
- Display content from custom post without modifying the single template
- How to Get Current Custom Post Type Selected Taxonomy Term (Not All Terms)
- Displaying a custom post types custom taxonomy value?
- Can I change header.php of current theme through a plugin function?
- Tried in different ways but sidebar not working?
- Short code not working in boostrap modal dont no why?
- Is there a way to list all actions registered by a plugin or theme?
- How to hook a custom user function to a wordpress core ajax action?
- Elementor custom Query with ACF fields to show matching woocommerce products custom fields
- WP Gutenberg Blocks – How to limit first/root blocks
- How developed with version control word press site on shared host? [closed]
- Following WordPress Markup Is mandatory, got awkward resultyby wordpress standard markup?
- How do I create plugin or theme using MVC pattern?
- PowerPress mobile media player
- When is the proper time to minify css and js with git workflow?
- Warning: include(): https:// wrapper is disabled in the server configuration by allow_url_include=0
- Plugin is not generating title tags on any pages or posts
- Is it necessary to do validation again when retrieving data from database?
- Make a plugin page out of influence of the theme’s style
- Update Data parameter of a wp_localize_script() call
- get_the_tags with separator control?
- 400 Bad Request, in wordpress theme development, wp_ajax
- Add child pages to submenu automatically
- Why in this archive page that call query_posts() function show only the last 10 posts?
- Why would you use esc_attr() on internal functions?
- How to find where an object first instantiatiation
- Full documentation about $args for register_rest_route?
- How to create taxonomy without using register_taxonomy () function
- How to replace settings in WordPress plugin from a theme
- Save temporary registration data
- How to remove/replace current page template?
- WordPress dynamic widget by location?
- Using password protection to load different page elements?
- How can the_excerpt (or equivalent) be called on a category description?
- Change the behaviour of a button
- WP_Query order posts by category
- Configuring Xdebug with docker compose
- How to access index file in Block Themes?
- WordPress Favicon not Working For Images/Videos/PDFs
- Want to know how to reveal a WordPress theme, considering the theme name is hidden?
- Redirection from a specific page for users logged in but not with membership
- How can we stop showing short code in create or edit post section
- Is it possible to develop themes and plugins locally while still allowing content to be updated directly in the admin dashboard?
- Replace “content-area” of themes 404 page with plugin?
- Autoloading & Namespaces in WordPress Plugins & Themes: Can it Work?
- Custom premium registration form and profile page for a WordPress Web Application
- Making Woocommerce optimized for more than 500k products
- How to destroy or dispose wordpress uploder/manager?
- Is there better way to do this without duplicating queries?
- Font Awesome stopped showing icons, shows &# text instead [closed]
- To remove rendering of menus and header, plugin or theme?
- Managing Custom Designed Content
- How can I add recent posts to menu like mashable
- Generate activation url
- Display Data’s metabox in page
- Ajax functions – no access to wp-admin.php only online
- Saving multiple fields as array
- How can I make my website with wordpress having on-spot editing feature as compared to concrete5 CMS?
- Gutenberg text field validation
- how to catch a data from a array in WordPress
- How react js and other Javascript Technologies works on WordPress plugin?
- Remove Gutenberg Buttons Block