Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End I need to get the category ID for a custom taxonomy Re: I need to get the category ID for a custom taxonomy

#123752
sanclementejoe
Participant

Hopefully some kind soul with the chops can help me out:

When I do this:

$terms = get_the_terms($post->ID, ‘stores’);

print_r($terms);
?>

It gets me close to what I want:

This is outputted:

_Array ( [47] => stdClass Object ( [term_id] => 47 [name] => Amazon.com [slug] => amazon-com [term_group] => 0 [term_taxonomy_id] => 49 [taxonomy] => stores [description] =>
Amazon Coupon Codes
Amazon is the world’s largest online retailer. The company also produces consumer electronics, and is a major provider of cloud computing services. [parent] => 0 [count] => 1 [object_id] => 40 ) )_

But I only want the number 47 in there