Addig custom url rewrite rule for custom post type slug


I have a theme which defined custom post types. This post type is having a listing page and a single item page for every item. The problem is I can’t change the slug for the custom post type and for the items, I don’t know where and how… So I was thinking maybe I could rewrite these urls with WP_Rewrite.

So what I want to achieve is change: to
and all the to

I tried to add this to my functions.php:

function listing_url_rewrite() { 

add_action( 'init', 'listing_url_rewrite' );

But nothing changed actually. So my question is, is it even possible with this rewrite_rule? If yes, what did I wrong? 🙂

Thank you very much!

VORiAND 4 months 0 Answers 26 views 0

Leave an answer