Simply i don’t want any word before the listing name, i tried changing permalink with %postname% but the word listing remain, i tried under permalink settings to change listing with another name and it worked example /ads/pink-moleskine-notebook/, but if the text box is empty so return back to listing.
I can’t find a solution, please, someone that help me to have the simplest permalink: site/postname/
Hello andrii,
i’m sorry but your solution work if i want to change the slug “listing” with some other word, so in this case in the Permalinks > Optional i can write my new slug, anyway i won’t any slug, my perfect url is sitename/postname, if i leave blank the slug field i have again the old standard slug “listing”.
Only this php code below worked, the url is right “sitename/postname” but all listings pages says no results.
This code is added to wp-content\themes\listinghive\functions.php
I see. Please note that this is a WP-level setting; you can change the slug, but it is required in any case for WordPress to understand that the listing page will now be displayed. The structure you want to add is already used by WordPress for regular pages in WordPress > Pages, please check this topic Remove slug from custom post type post URLs - WordPress Development Stack Exchange
As for your snippet, it looks good, post types are being overwritten like that. After you add it, please update the permalinks How to refresh WordPress permalinks - HivePress Help Center
Thanks a lot andrii,
i read the article and understand that is possible to do what i thought to do, anyway it’s a little bit difficult and they says can be unstable, so i decided to customize the slug instead of remove it, so thanks for your help.