this will work:
$terms = wp_get_object_terms( $post->ID, 'wpsc_product_category' );
foreach($terms as $term){
if($term->parent != 0){
// this category has a parent and its id is $term->parent
}
}
Related Posts:
- get_the_term_list without links in 3.1
- Exclude specific slug in ‘get_terms’
- wp_insert_term – parent & child problem
- Custom order of terms for custom taxonomy in admin and website
- Is there a way to disable a term rather than deleting it?
- Modify Term Update Redirection
- How can I select a primary category?
- Return only the custom sub-term for custom post type, do not echo term-parent
- Check if current term is a child of another term
- get_terms() doesn’t return empty terms even though hide_empty is false
- Formating the_terms() function output
- Custom Taxonomy Only Showing Top Level Terms in Admin?
- Get current term’s ID
- Is it possible to get a Previous/Next Taxonomy term archive URL?
- Looping Through Custom Tax Terms and Displaying All Posts For Each
- How to get the top most term (top ancestor) of a custom taxonomy child term?
- How to set hierarchical terms to a post using wp_set_object_terms
- Echo taxonomy term meta on author.php
- get_the_term_list without specific category
- Hierarchical display of custom taxonomy
- How to display term description in empty terms archive?
- Checking if a Page has an Associated Term?
- What are terms and taxonomy, how they related to post and how these three are stored in database?
- Get terms ordered by post date
- Allow only 1 instance of each term in each custom taxonomy
- get_the_terms() to show all custom taxonomies
- How can I get WP to build a feed based on multiple taxonomy terms
- Removing the “Popular Terms” area from the Taxonomy Edit Screen in the Admin Area
- get_terms: determine if taxonomy term has children
- display taxonomy slug from term ID
- get_term_children doesn’t return an array of children terms
- Get Current Custom Taxonomy ID by Post ID
- Changing stylesheet depending on custom taxonomy terms
- Taxonomy archive showing no results
- Use get_the_terms to list subcategories of custom taxonomy
- get_term and get_term_by return null or false, even though term exists
- Display Taxonomy Terms in an option tag with value being the slug
- Changing taxonomy term by slug (wp_update_term)
- Custom Taxonomy Term Caching?
- Displaying Custom Taxonomy without a hyperlink
- Get only immediate children (and not grandchildren) of a hierarchical custom taxonomy term
- How to group all terms children’s in custom taxonomy?
- Show template part if part of term
- one post per term taxonomy
- How can I change the output display of my pagination?
- Corrupted nav-menu?
- Get name of taxonomies of current page
- Create alphabetical Pagination for custom taxonomy?
- List Top 5 taxonomy terms based on number of post
- Taxonomy Overview Page?
- Order taxonomy terms wordpress
- Unable to get the Parent Custom Taxonomy Terms
- How to get the term description in a taxonomy term archive query?
- Unsetting post_tag taxonomy breaks term description for other taxonomies
- Include get_term_link inside search
- Trash Bin for Categories?
- Set two terms for a post when they differ only by an accent
- Retrieve the child terms by having the parent’s information
- add pagination in wordpress page template
- Listing Cities A custom taxonmy by selection order
- Cloning product not copying custom taxonomies
- How to create a non removable taxonomy term?
- Filter “get_terms” query
- generate random slug when adding taxonomy
- Get Highest and Lowest get_term_meta() value from Taxonomy Term
- How to get a terms and posts associated with another term?
- Displaying subcategories and then posts in taxonomy template
- Why get_terms() behaves strangely when being called in admin (for use in meta box)?
- set_object_terms for custom taxonomy in custom post type – not working
- qtranslate-x problem with custom term description
- Resize $term attachment using url
- switch statement for taxonomy content
- Display taxonomy term slugs
- Taxonomy term breadcrumb; how?
- Exclude 2 in 3 terms of A Taxonomy from all Archives
- get_terms() – unexpected ‘=>’ (T_DOUBLE_ARROW) error
- Display woocommerce product_cat child terms with thumbnails
- Custom Search only for my Custom Taxonomy Page – data
- How to delete unused terms?
- How do I check if a post has a term with a particular ancestor/parent?
- Get value in custom field with taxonomy [closed]
- Get second level terms of custom taxonomy
- Get taxonomy name of current post
- Custom Fields and performance
- Sorting taxonomy columns by meta value numeric
- How to check the terms in single custom post type template
- Get_terms stopped working after WP 4.2
- Show only the grandchildren (using get_terms)
- Custom Taxonomy Term Archive Page Template that Filters 2 or more Taxonomies
- Display all posts that use a custom taxonomy
- Override Taxonomy Template
- Display custom taxonomy attached to the post on post single page
- Get Comma Seperated Taxonomy Linked Terms and Last Child Separated By “&” Instead Of Comma
- Custom Taxonomies Archive Page 404
- How to replace custom post type with custom taxonmy in permalinks
- Restrict viewing of posts by category, user role
- List terms and order by second word
- add custom fields in custom taxonomy meta box in wordpress-3.5.2
- How to permanently delete a taxonomy
- Taxonomy Archive URL + Template