I have the link like below :
http://localhost/rajab/product-category/pvc-hose/
the term "pvc-hose" is the category slug. I wanted to derive the category name from this slug name. I wanted to display the category name becaus the slug name is having the "-" in between.I dont want this when i am displaying the category slug. How to remove this ?
Use get_category_by_slug. E.g.
<?php
$catObj = get_category_by_slug('category-slug');
$catName = $catObj->name;
?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With