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.
If you want to get category details by
category name
,category slug
, andcategory ID
then you should useget_term_by()
.Reference Link