Check if it works for you… i have modified the loop
/Woo Cat product
$woo_single_cats = get_the_terms( $post->ID, ‘product_cat’ );
if ( $woo_single_cats && ! is_wp_error( $woo_single_cats ) ) {
$woo_single_cat = array();
foreach ( $woo_single_cats as $term ) {
$woo_single_cat[$term->term_id] = $term->name;
$term_parent_id = $term->parent;
$parent_term = get_term($term_parent_id, 'product_cat');
}
$woo_single_cat = apply_filters('seopress_titles_product_cat', $woo_single_cat);
$woo_single_cat_html = stripslashes_deep(wp_filter_nohtml_kses(join( " - ", $woo_single_cat )));
}
Related Posts:
- exclude multiple terms using get_terms() function
- Counting number of posts in a category and its sub categories and displaying result using shortcode
- Allow authors to post only in categories they create in WordPress
- Add custom field to attachments in a specific category
- How to Populate the list of custom post type categories
- Php string not working in WordPress Functions.php [duplicate]
- Problems with function on function.php
- Use template for posts with a particular category grandparent
- Check if Product is in a Specific Category in Functions.php
- Woocommerce – remove product from category
- get current product name in functions.php
- get post based on category chosen in drop down – The ajax method
- Swapping wp_dropdown_categories function with wp_category_checklist
- Pass Category Name, Description and Photo into variables to pass to jQuery
- How to pick the default selected value in wordpress dropdown?
- Get page that displays all children of taxonomy parent
- Dilemma of Populating all the categories in a drop down list
- Edit the_category (); for a hierarchical display
- Displaying posts based on category
- How to get current post category details inside “loop”?
- Show all tags within a category?
- Post not populating for custom post type based on category selection
- Dropdown category field inside repeatable metabox
- Display Visual Composer shortcode if a post belongs in specific categories
- How to move a post from one category to another
- Notice: Undefined variable
- Hide a specific category title from displaying on site
- Populate Posts based on category selected using AJAX that means without page refresh
- All categories options or All categories not Populating
- Customizing the output of the archive and category widget without altering the original behavior of the widget
- PHP get_category() function redeclared
- Get category id for a custom category and display it in a class
- Trying to see if page is category or single and displaying title with appropriate heading tag
- Displaying categories
- How to insert the first letter in uppercase [closed]
- Hide child of parent categories already hidden with “get_terms_args” – Woocommerce
- Exclude a category ID from the following function
- What does the token %1$s in WordPress represent [closed]
- Customize default settings on new sites on multisite
- Check if a menu is empty?
- Remove class that has been added by parent theme
- Setting up the child theme so as to enable right-to-left WordPress?
- Design view breaking on Pages
- How to display related posts from parent category
- Hooking new functions to actions + passing parameters
- How to break down importing of feeds
- Create Logout Link WordPress Admin Menu
- Use wp_get_recent_posts with search term
- Calculations in functions.php [closed]
- Choose To Display Post Views With An Options Panel
- Prevent Data Resubmission On Page refresh
- Get_avatar filter?
- Recent Posts Not Showing Only On A Specific Category Page [closed]
- Custom gallery in wp3.5
- How can I modify footer when footer.php calls to another file?
- How to use theme function in post/page?
- esc_url( ) won’t use https
- Where is this function’s callback getting its arguments from?
- Warning: in_array() null given in PHP function
- Use post ID in functions.php file adminside
- How to: Conditionally Enqueue JS and Stylesheets, for Custom Post Type (Single and Archive Templates)
- How can I count ACF sub_field with a certain value
- change the default order of posts only for specific categories
- Displaying list of posts in category page
- Problem with adding custom CSS class to image in ACF Photo Gallery plugin [closed]
- Custom posts password protect
- How to get post category list as select in front-end?
- How to use functions [closed]
- Splitting the_content() by size?
- Function to call either single post or category
- Pagination at category doesnt work with same name of page
- Updating Metadata with Shortcode
- can’t load .po file in functions.php
- Woocommerce – Exclude variation attribute on specific variation
- How do I add a function to parent theme
- Are there any drawbacks on opening a session_start in functions.php and header.php?
- Create shortcode for metabox gallery
- Child-Theme Category View with modified permalinks (%category% removed)
- Add Pre-Defined Value to Click Counter in WordPress
- How can I redefine WordPress wp-content directory programmatically?
- Child theme overirde template-tags in a theme built on underscores in inc/template-tags
- Delete post meta by serialized meta value
- Menu not updating for logged in users after redirect
- Create a temporal post
- Add parent menu item in sub-menu in custom nav_walker
- Save the outputted image into the Media Library, with a different filename and extension
- Custom Taxonomy as Link
- How to fix blank pagination links?
- adsense code showing on random post thumb
- get_category only returning details for ‘uncategorized’
- How to extend the page editor?
- Hide empty categories from get_categories
- I need a button to appear when not loged in and another when logged in, I need help fixing code PLEASE!
- How to hide .js files on wordpress website using php or wp plugins or any? [closed]
- WP Custom tables query
- How to add different menu items on different menus?
- How to limit number of posts in the certain category and exclude the oldest post automatically
- Function for Post Creation plugin for Gravity Forms
- child category under correct parent
- Modify the permalink structure for a specific category