Solved

Wordpress - Get parent taxonomy name for a post

Posted on 2011-09-27
1
546 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
drop down navigation on mobile devices adds spaces 3 77
MSSQL 2008 with mySQL webservers 7 43
Word Press Enigima 7 38
manage footer size 4 12
Did you use a default hosting installation of wordpress with the intention of it being your actual site?  Maybe you’ve installed it as a Blog to your current site and recently converted it to be the main site and do away with the old .htm pages.  An…
Now that you've installed WordPress 2.9 (http://www.experts-exchange.com/articles/Web_Development/Blogs/WordPress/WordPress-2-9-What-to-Expect-When-Upgrading-to-WordPress-2-9.html?) on your site, you need to install some plugins to get the most out …
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…

895 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

14 Experts available now in Live!

Get 1:1 Help Now