How to show only parent category name(using is_shop)
-
Hi,
I’m trying to add category parent name above page name, for example if breadcrumb is:
home/shop/shoes/example-product
then in single product page(or category page) it would look like it:
> Shop
Example Productright now it’s only
Example Product
I’ve tried using:
<?php $parent_title = get_the_title($post->post_parent); echo $parent_title; ?>
and it works in normal pages, even in product categories but in single product it gives product name instead of parent category name. It’s kinda weird, since all my products are assigned to categories.
Any help with that?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How to show only parent category name(using is_shop)’ is closed to new replies.