Hot answers tagged

3

You can accomplish this with add_rewrite_rule(). I personally like to show this example in a class to make it copy/paste ready. You could throw this in a plugin or functions.php -- some place that loads this code before query_vars, parse_request and init. The goal is to add rewrite rules, make sure you can add custom properties to the main query, then ...


2

I'd put an is_user_logged_in conditional into my theme's 404.php. Then for logged in users show a form with the new slug as a hidden or uneditable field that creates a new page and redirects to the admin edit screen for that page.


1

Ok, i have some basic ideas. You can install a plugin called Redirection. And after that, you can make like and redirect to some other pages with you own data. but URL will change as the person redirect to the other specific page. Now if you want to them to land on the specific page... you need to make the folder into server directory under the main site ...


1

Somehow the url must make clear that this is an editable link. So you need a filter on the_content that checks if there are internal links that do not yet exist. Alternatively, if you let users determine which links are editable you need to check if the url's they give perhaps already exist. The filter should set a class on the link. Here's a function to ...


1

You're using the reserved public query variable name as your custom one. It can e.g. affect the canonical redirect by setting page_id and name for a different page. Change it to something else to avoid possible name collision, like kenan_video_slug: add_rewrite_rule( '^watch/([^/]*)$', 'index.php?pagename=watch&kenan_video_slug=$matches[1]', ...



Only top voted, non community-wiki answers of a minimum length are eligible