Skip to content
Advertisement

Tag: slug

WordPress redirect to ID from slug

I have a front-end editing form, where users can update specific post data (ACF custom fields). The problem is, that the users only know the post slug, not the ID. So I need a page before, where I can convert the slug to post ID, then pass it as a url parameter, and redirect to the update page above. I

WordPress: Add directory to post slug with function

I want to add a /news/ before every post slug. Like this: example.com /news/ post-slug/ If I add the /news/ in the permalinks settings, every custom post type is broken after it. I tried to add the following to every register_post_type: But that doesn’t help. I also tried the code from here: Unfortunately that doesn’t work either. Is there any

Advertisement