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
- How to get the original price of the product in woocommerce?
- How to redirect users to custom lostpassword page?
- Can I write ‘RewriteCond’ using ‘functions.php’?
- How to add 2 posts under another post? Formatting should be intact
- Validate a users email address when using gmail to register
- Get widget settings function?
- Edit category output
- Different background-image by category
- enqueue multiple Google fonts with multiple weights and styles (italic)
- What is the fastest way to load PHP functions that are only used in one theme template?
- Adding tawk.to code just before body tag on functions.php file
- add_action shortcut?
- remove wp floating submenu in wp dashboard
- ACF: how do I get the fields and its values of a specific group?
- How to complete two other input fields, completed the first
- Function to capture a value and store it in a variable
- Adding a widget function into the php theme file
- My new button is in the wrong place
- Checking array against author id in loop
- Call to undefined method – Download Monitor
- How do I link a button I created in theme customizer to a function?
- How to change menu labels
- How to obtain the current website URL in my theme?
- Remove Custom Divs from AMP pages
- Read array in php?
- Tell WP register script to load a script only when the entire page is loaded
- Can’t save php string to a custom field
- get_template_directory adding FTP root folders in urls
- Fatal error: Call to undefined function register_new_user()
- Is it possible to display a DIV to not logged in users and then change it for users who are logged in?
- Remove extract from function
- Undefined offset: 3 in custom function
- Changing the order of custom fields in the dashboard for Woocommerce variable products [closed]
- call_user_func_array() expects parameter 1 to be a valid callback, function ‘———-‘ not found or invalid function name
- go to home page when i select default in select-box
- Wrong Number of Products When Hiding Subcategory Products From Showing In Parent Category
- Can/should we delete wordpress cron jobs with no action?
- Database entry removed on browser refresh, Ajax PHP jQuery
- Add Featured Image to Existing Post
- How to use data URL in WordPress?
- Flushing the slug base has no effect and does not change
- WordPress Ajax filter: Create two loops for different output styles?
- Handling form actions in WordPress
- How to call a function from functions.php with ajax?
- Set user status to absent on WordPress
- Shortcode’s output to use as other shortcode’s parameter
- How to Retrieve All Category Images on Front-End
- Displaying POST content with HTML tags and all
- PHP script to redirect traffic based on website accessed
- How to remove title tag with this filter
- Showing wordpress latest post thumbnails in slider with auto increment
- My function echos only “array”
- Notify admin (by email) if post added with specific tag
- Retrieving specific images from Media Library
- Can’t put a hyperlink on Featured Post’s Image
- Limit Taxonomy Parents
- WordPress HTML Helper
- List sibling pages widget, exclude current page
- How to add button to top of theme customizer?
- Send foreach $_post method to contact form 7 [closed]
- Options.php loop won’t show!
- Background Tasks in a WP Cronjob?
- Tags being Inserted in html from plugin PHP not passing through the_content