<?php remove_action('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10);
function loop_title() {
global $post;?>
<div class="col-xl-3 col-md-3 col-sm-3">
<h3><a href="https://wordpress.stackexchange.com/questions/304779/<?php the_permalink(); ?>" class="feed-item-baslik"><?php the_title(); ?></a></h3>
<?php
$terms = get_the_terms( $post->ID, 'product_cat' );
if ( $terms && ! is_wp_error( $terms ) ) :
if ( ! empty( $terms ) ) {
echo $terms[0]->name;
}?>
<?php endif;?>
</div>
<?php }
add_action('woocommerce_shop_loop_item_title', 'loop_title', 10); ?>
Replaced get_the_category() with get_the_terms(). Hope this helps !!
Related Posts:
- Remove child products from woocommerce category page [closed]
- Remove product category placeholder image (Woocomerce)
- WooCommerce – How to show specific category first-rest of products-specific category last
- Do not show sub categories in the loop on archive-product.php
- Remove any product that is featured from regular display loop [WooCommerce]
- Two Sections on Woocommerce Catergory Page [closed]
- How to check if I’m on the last page of posts?
- Default WP Gallery – show only galleries of a certain category
- Programmatically create product category and add thumbnail in woocommerce
- Create product category and keyword search form in woocommerce? [closed]
- Loop with Dynamic Categories
- How can I create a loop to build slides based on multiple categories using Coda Slider
- How do I edit pre_get_post for the category the user is currently in?
- Categories list loop – add separator every year
- How would you create a “weekly” archive?
- How to exclude categories from recent posts, recent comments & category widgets?
- Listing all posts from current category on page
- Hide uncategorized products from the shop page
- Listing Parent, Child and GrandChild Categories and then the PostTitles on Page Template !
- Category archive page – loop through posts of certain tag (with pagination) – pre_get_posts
- Get woocommerce catogry
- Class active for Archive link – looped out
- need to add custom field in more products
- Taxonomy name repeating when showing 2 posts from each category
- How to redefine the sorting of product categories by menu_order?
- Best way of getting WooCommerce category path
- Display the last post by each category?
- Get parrent category name
- Sorting category products not working
- Counter in loop in foreach
- Multiple Loops on category.php with pagination on last loop
- How to exclude the last post from a category(featured for example) from the main loop?
- Order by category titles
- ajax for filtering posts by category in wordpress loops
- Limit get_categories to show each category once
- Building Menu from Woocommerce Product Categories
- Include WooCommerce product to all child categories
- woocommerce related products by specific categories [closed]
- Show Posts from Single Category Not Working
- Is there a reason I cannot get the current category in a loop?
- Pagination on category.php and tag.php not working
- new WP_Query all post in a category inside the loop
- Problem with different query loops (and “main loop”) on category template page!
- How to do paging in the loop?
- How to add orderby parameter for sorting on category.php
- How to loop custom post_type from (a) specific category(ies)?
- List just subcategory and products of active category page in Woocommerce
- Display all product tags associated with a specific product category
- Category tags with comma’s
- Display posts of certain categories to specific user roles
- Template for product-category page [closed]
- Category nicename inside loop in wordpress
- filter a loop base on specific category
- Problem with multiple loops in wordpress theme
- multiple values in an array for category__and does not work with WP_Query
- Editing Loop So It Targets Specific Tags?
- How to get posts using category slug in ClassiPress?
- Posts made to category don’t show up (do show up on frontpage)
- displaying the last product comment in the woocommerce category
- Display all categories but only if they have posts in them that have a specific tag assigned
- Woocommerce only display child category when parent is checked (on add new product page)
- Show audio player only in specific post type category
- How to make product image inherit from category image
- How to set acf color field as background color to product category
- How to target all woocommerce categories that don’t have any subcategories in them?
- In if…else condition, the else statement shows even if if statement is correct
- How can I display all products from all categories on one page with woocommerce?
- How to add all subcategories as submenu in WordPress menu
- How to edit woocommerce sub-category page
- selecting categories that have products with tag/category
- How to distinguish pages created by woocommerce?
- Restrict retrieved terms by category?
- Please tell how to stop the category from showing up on posts
- Woocommerce Category Sort Dropdown
- Woocommerce: all products of all categories instead products of one category
- Loop by category and meta_key
- How to get WooCommerce Product Categories and its children’s children?
- Woocommerce change tag_id to name
- Assign a class to first element in category in loop
- Category page shows only 1 post when that post has more than 1 category?
- Configure query with multiple categories in a custom order?
- How can I modify this code to iterate over an array of categories?
- How to exclude a specific categogy from a custom page template
- Display one post on category.php: Wrong featured image
- Category menu that filters out empty categories
- WordPress Numeric Pagination with Query String [duplicate]
- My Query is getting the wrong data
- How do i add custom post types to this query?
- Custom WordPress category page showing all posts rather than the specified category
- Do not show all post from all categories, just show posts from category in current loop
- WooCommerce category display in custom page
- Sorting Woocommerce products by category and attributes
- Woocommerce custom taxonomy order
- Echo Category In Loop
- Update wordpress menu with woocommerce products
- How to get Woocomerce categories count
- Get all categories
- Function to reference post meta in place of category Woocommerce
- Get categories by title descendant
- Add custom fields to Woocommerce Category Page