I’m trying to amend the permalink for some things on my site but for some reason it’s not working. I’m using preg_replace to remove a part of the URL so it will create a new URL.
Here is some info:
the_permalink() currently returns a URL like this:
http://mydomain.com/cpo_feature/postname/
I want to remove the “cpo_feature/” part so it becomes:
It’s a custom post type so the slug is being put in there. I believe that’s standard procedure for custom post types. Which is why I’m trying to remove it because I want to link some featured boxes to the relevant page on the site but the boxes are created with a custom post type so I need to change the permalink.