Keep in mind that the return value of get_the_terms()
can be of the type of
array|WP_Error
Your snippet should check if you get the correct type returned
$terms = get_the_terms( 0, 'product_tag' );
if (
! is_wp_error( $terms )
AND is_array( $terms )
AND ! empty( $terms )
)
{
foreach( $terms as $term )
printf(
'<a href="https://wordpress.stackexchange.com/questions/163332/%s" style="font-size: 8pt; margin-right:5px;">%s</a>',
esc_url( get_term_link( $term ) ),
$term
);
}
Related Posts:
- Show post tags in a widget
- Is there a way to add more tags to the tag cloud?
- Custom Tag Cloud widget missing tags
- Show tags selection similar to category selection in WordPress
- How to filter products using filter products by attribute widget and OR logic between different product attribute types?
- Is it possible to display tag cloud widget by category?
- displaying tags in a widget
- Making tags appear as an Unordered list instead of a ‘cloud’
- Trying to filter tag cloud args, but it removes the wrapper
- Jquery checkbox -show posts with checked tags
- Sorting Tag Cloud by Popularity
- Display current tag archive’s name and description in sidebar
- Change Widget that display posts from categories to tags
- Programmatically add widgets to sidebars
- Is There a Difference Between Taxonomies and Categories?
- WordPress 3.8 – Dashboard 1 Column Screen Options
- Executing Javascript When a Widget is Added in the Backend
- Loading scripts only if a particular shortcode or widget is present
- Limit number of Widgets in Sidebars
- How Can I Add the “Insert From URL” Tab to a Custom 3.5 Media Uploader?
- Give Editor Access To Sidebar
- How to load Widget javascript + css files only if used?
- Where is the content of widgets stored in mysql table
- Hide specific categories from category widget
- changing wp-admin/widgets.php
- Add class to before_widget from within a custom widget
- How can I use the built in WordPress “browse link” functionality?
- Is there any way to dynamically alter widget titles?
- Translate widget titles using qTranslate plugin
- Code for Recent Posts Widget
- Get number of widgets in sidebar
- Text Widget creates a
- Can a widget in the Customizer be “single-use” (i.e. disabled after 1 instance has been added)?
- check if registered sidebar is active & has widget content
- How to edit widgets in WordPress
- dynamically add scripts to WP_Widget widget() method
- Extend WordPress 3.8 Site Activity Dashboard Widget to include more comments
- How to use is_active_widget?
- Get a list of all Widgets registered in WordPress admin widgets-area
- Modifying the default search widget
- Adding iframe Content to Sidebar Widget
- Enabling jquery when dragging available widget to sidebar area
- Control term order on a per-post basis
- How Do I Add Custom CSS To Only Certain Widgets
- Get Widget Instance inside Widget
- Author template, filter sidebar widgets by author?
- Prevent widgets removal
- Add the sidebar/widget editor to the post edit screen?
- WordPress 4.8: Using multiple WYSIWYG-Editors with media inside of Widgets how to?
- Does the number of widgets installed affect website performance?
- WP_Widget deprecated error in WordPress V4.3
- What is the quickest way to make a widget?
- How to display custom widget anywhere
- Show Woocommerce minicart widget in checkout page sidebar? And, how to make this update secure by overriding widget?
- Get page IDs based on which template they are using?
- Changes in widget customizer not triggering ‘save and publish’
- Add filter to blogroll widget
- Widget Options Not saving
- Indexes of widgets instances starts with ‘2’ in ‘wp_options’ table
- How to use wp_dequeue_style() for style enqueued in WP_Widget class
- Complex widget form UI – examples and best practices
- How do i manually place a widget code
- How to override the wordpress default widget markup
- Why is the $old_instance needed for the widget update function?
- Embed iframe or html page into dashboard widget
- What is the difference between terms and tags?
- Storing custom dashboard widget options in wordpress
- Get sidebar parameters (before_widget, before_title, etc.) from within a widget
- Prevent second widget activation
- How can I add links to widget titles?
- How to refresh Theme Customizer after change color inside wpColorPicker?
- How to add image uploader to a custom widget?
- PHP Coding Standards, Widgets and Sanitization
- Different widgets on different page templates?
- How to Remove All Widgets from Dashboard?
- Widgets not displaying in theme customizer
- $post>ID displays wrong post ID
- Register multiple sidebars
- Modify recent post sidebar to show post thumbs with out plugins
- Loop through widgets in sidebar
- How do I rebind event after widget save
- Programmatically edit the text of a widget
- How to add color picker to widgets?
- Where to find the source code of a widget?
- How to add author details in the post sidebar?
- Widget to display custom taxonomy tag cloud
- How to delete cached transients from a widget instance properly?
- What is this instance variable doing in the Widgets class
- How to add a filter to all widget output
- show tags of custom post type ONLY
- Determining a Widget Instance and Sidebar Location?
- How to Validate Widget Input
- How to build widget with arrays inside arrays?
- Randomize widgets displayed in my sidebar [duplicate]
- How do I save data from submitted form from widget
- Calling static method in the Widget Class
- Video Embed in Sidebar Widget with Links to Others in Category
- Remove before_widget / after_widget content from Wp_Widget_Text
- How to add Custom Fields to Settings in Widget Options for all Registered Widgets?
- Why Can’t wp_editor Be Used in a Custom Widget?