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?
- Has anyone tried putting PHP ActiveRecord on WordPress?
- How to find objects by terms
- Counting number of posts in a category and its sub categories and displaying result using shortcode
- 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?
- Successful or Error Message after running mysql code in functions.php
- Filter link to existing content suggestion
- Can I view my own wordpress php source code on my hosted web server?
- PHP Customization: Taxonomies and Queries, why? [closed]
- Display Post co-authored in Author Page
- How do i get (unique) page name?
- 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?
- conditional statement for custom taxonomy
- Get taxonomy terms only of the WP_Query current posts
- 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
- How to properly insert a link to a template in WordPress?
- Rename “Portfolio” slug?
- stats_get_csv (WordPress Stats) to only display top posts (not pages)
- Hide wordpress field if data is empty in post!
- 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
- Latest post in a specific menu
- get_the_tags() not iterating through for/while loop, but will with foreach
- Customising the search function?
- Cause of Blank Lines Being Added to WP FIles?
- How to save checkbox values for logged in users?
- Add meta noindex to post if it has a specific taxonomy
- Loop through categories and display posts title under each dropdown
- Changes in permalink structure in WordPress and how to apply to in-site links
- Displaying Hierarchical custom taxonomy
- 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?
- Log in / Log Out Custom Button
- 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
- Category title output before opening title tag
- How to get post permalink url without a href
- 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]
- Next post link on a bootstrap button
- Hide image if taxonomy term is empty
- Isotope Drop Down Categories Filter Function
- trouble with page_id & highlighting current page
- How to Configure Events List in WordPress to Disappear Event Once Date is Past
- How to filter custom taxonomy term name, slug, and description?
- Code snippet to show current php version inside “At a Glance” box in admin
- Hierarchical taxonomy list with modificated term links
- Add class to website based on post taxonomy
- Fatal error: Uncaught Error: Call to undefined function get_header() [closed]
- 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?
- Change header on pages displaying taxonomy items
- Automatically Add Page Links to Nav Menu
- WordPress site with embedded menu – gives You don’t have permission to access /wp-content/themes/xxx/taxonomy-redirect.php on this server
- 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]
- Taxonomy term count
- How to get all the items of a taxonomy even if it does not have a custom post type?
- Adding custom url to readmore link using get_permalink()
- 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
- PHP code snippet to remove microdata
- 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?
- How to change the author box selection on a post to a custom taxonomy
- WordPress: Export/Import Yoast meta title & description to custom taxonomy
- Counting number of posts in multiple (sub)categories using shortcode
- Obfuscate links (for SEO purpose) [closed]
- Need help for some PHP code
- Show related products by attribute based and certain conditions
- Display acf taxonomy attachment