Solved

Wordpress - Get parent taxonomy name for a post

Posted on 2011-09-27
1
543 Views
Last Modified: 2012-05-12
I have a custom post type called 'riders' and a custom taxonomy called 'regions'
A particular rider has a region of 'United States' - which has a parent of "North America.'

I can use get_the_terms() to retrieve the parent ID, but not the parent name.  How can I get the parent name 'North America' for a given post?

0
Comment
Question by:aguawebdesign
1 Comment
 
LVL 31

Accepted Solution

by:
gwkg earned 500 total points
ID: 36714549
Using the term id, you can get the name, slug and description with get_term()

$term = get_term( $term_id, 'regions' );

$name = $term->name;
$slug = $term->slug;
$description = $term->description;
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Who says nothing in life is free? WordPress.com is a freebie. WordPress.org's downloadable publishing platform is free. Heck, even WordPressMU is free. WordPress is an open source project, which means it can be used on any personal or commerc…
In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now