Hello !
I am trying to customize the listing categories block, to provide direct links to this category for vendors and services like so :
So I finally figured out that I can copy / paste then edit the listing-category-description.php (my-child-theme/hivepress/listing-category/view/listing-category-description.php). Yes, I am slowly getting the hang of it.
But I need to retrieve the slug of the category to create the links.
At the moment, I am able to retrieve the category name, id :
$listing_category->get_name();
$listing_category->get_id();
But I would like to retrieve in the case of “Music & Audio”, something like “music-audio” (well, the slug), is there a way to do so ?
I tried debugging with print_r($listing_category);
but the slug is not showing.
In “native” WordPress, it would be easy :
$slug = get_post_field( 'post_name', get_post() );
But for some reasons, I can’t manage to get this for the moment…
Cheers !