Solved

Wordpress - Get parent taxonomy name for a post

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
WordPress Header Issue 9 47
Max-width on individual images in grid 4 58
WordPress syntax 2 33
CSS Header Navigation Not Responsive 4 26
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 …
How to create your own WordPress Theme Before I begin with the theme design tutorial, I would like to give you the basics of what is required to make a WordPress Theme. The most basic WordPress theme only requires 2 files: a style.css file and an…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…

791 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