You could use get_the_terms()
and wp_sprintf_l()
:
function wpse_52878_term_list( $args = array() )
{
$default = array (
'id' => get_the_ID(),
'taxonomy' => 'post_tag',
'before' => '',
'after' => '',
);
$options = array_merge( $default, $args );
$terms = get_the_terms( $options['id'], $options['taxonomy'] );
$list = array();
foreach ( $terms as $term )
{
$list[] = $term->name;
}
return $options['before'] . wp_sprintf_l( '%l', $list ) . $options['after'];
}
echo wpse_52878_term_list( array ( 'id' => get_the_ID(), 'taxonomy' => 'portfolio_cats' ) );
Another option:
echo wp_strip_all_tags(
get_the_term_list( get_the_ID(), 'portfolio_cats', ' ', ' , ', ' ')
);
Related Posts:
- Taxonomy linked to pages
- What is the meaning of %s, %1$s etc.? [closed]
- Include WP_Query in my own PHP file?
- Add a class to links in the visual editor (how to get old dialog back)
- WordPress custom taxonomy description for each post?
- How to find objects by terms
- Copyright info change in Theme Child PHP
- Display certain amount of posts on taxonomy archive page
- Add footer.php to WordPress child theme
- How do I get taxonomy terms by ID in a specific order
- Can I run custom php on specific pages in wordpress?
- Can I view my own wordpress php source code on my hosted web server?
- PHP Customization: Taxonomies and Queries, why? [closed]
- Change links automatically to affiliate links
- Make first letter of my taxonomy uppercase
- How to display posts of specific category using a custom Query in WordPress?
- How to display php source code inside a post using visual editor?
- The custom logo, site title, and description doesn’t appear at the same time
- Shortcode return function with link href inside PHP
- stats_get_csv (WordPress Stats) to only display top posts (not pages)
- How to get the POST TITLE using the POST ID?
- Custom page archive query by url var calling page twice on one of my custom queries?
- Create a hierarchical taxonomy list in WordPress
- wordpress count link clicks by ip address
- Loop through categories and display posts title under each dropdown
- Changes in permalink structure in WordPress and how to apply to in-site links
- Get term siblings of current child taxonomy
- How to get post’s current parent term ID?
- Adding Taxonomy Image to taxonomy loop [closed]
- register_taxonomy() take much queries
- Insert custom PHP head above in WP pages
- Way to bulk make all my tags lowercase?
- How to do a code in php and have text before it? [closed]
- Make Current/Active Page Number a Link (WP_LINK_PAGES)
- PHP nested If statement syntax
- List taxonomy term slugs within shortcode (do_shortcode)
- Display Data in Table from External Database in WP using Shortcodes
- get_template_directory_uri() providing wrong path for img
- Copy taxonomy terms from one post to another programmatically
- Trying to prepend a Hashtag symbol to the_tags links [closed]
- Isotope Drop Down Categories Filter Function
- trouble with page_id & highlighting current page
- How to use the wpsnonce clone post link?
- Show the section only if custom taxonomy was chosen
- Extract links from content
- Exclude product attributes from taxonomy terms loop
- How to insert wp_users ->user login name to wp_terms when a new user registering?
- with PHP within splits the link
- using wp enqueue style to create a CSS file specifically for a page template
- Accidentally deleted php code in WordPress website [closed]
- How to get all the items of a taxonomy even if it does not have a custom post type?
- Filter unique custom field value based on custom taxonomy category or other custom field
- random reason on refresh
- Trying to display terms from custom taxonomy within function
- Insert PHP code in Text
- WordPress Conditional / Multiple Taxonomy Query
- Hi need update in my terms for other taxonomy
- How to set all External Domain Links with nofollow Attribute from Header Footer Content and Excerpt using PHP?
- Obfuscate links (for SEO purpose) [closed]
- Show related products by attribute based and certain conditions
- How to hide a child category and show his parent category
- Woocommerce display orders with products from specific categories to specific admins
- update_term_meta() only updating once on certain meta keys
- Woocommerce template file outputting tags
- Copying and pasting to WordPress “code editor” code via the front end and clipboard
- How to preload header logo image in WordPress? like what’s the code and where do I put it?
- How to enable HTML tags in category description without breaking the category page
- How to put 2 php codes in functions.php without site crashing
- ACF – Can’t get custom post type by taxonomy
- opens like sitename.com/URL
- Link to index.php from home.php?
- Displaying SQL query result from user input via wpdb
- Permalink like example.com/taxonomy/post_type/postname
- admin-ajax.php 400 bad request – whats wrong with my code?
- Displaying child taxonomy before parent
- New term taxonomy and description in front page. Input’s
- Multisite – Display different header content based on which site is accessed
- Wrapping shortcode content in a span or link
- How to associate dynamic PHP page for chosen WordPress tag?
- How to hide the Duplicate taxonomy values in WordPress?
- changing static link to relative link
- Display product attributes for current product
- Links in footer section
- problem with category menu, it doesn’t want to show link
- Custom Taxonomy as Link
- How to link a word comprised of a custom field with another?
- Blog only showing code
- Display pages from specific page template
- Get all the contents of taxonomy and sort by term
- why is markup routinely placed in functions in wordpress?
- wordpress taxonomy in regular posts
- Open all external links in new window – need help with the code
- PHP code for link with text
- Where to put include php file?
- Can you not edit the HTML and PHP of your WordPress without paying?
- Is there a way of displaying related posts from lowest hyrachical order (lowest child category to parent category)
- Custom taxonomy with page post type – WordPress
- How to extract URLs from wordpress taxonomies
- Remove content links (internal and external), but exclude post at specific categories
- WordPress taxonomy and terms question