Problem

I’d like to have any child page url like http://www.foo.com/fooparent/foochild automatically turns into http://www.foo.com/fooparent/#foochild

Could this be done with htaccess rewrite rules or any kind of WordPress hook?

Use case

I have the parent pages loading all the child pages content in the template. It’s utilizing a onepage layout with anchor links scrolling down the page to each section as you navigate. There are cases where permalinks of the child pages are exposed and that would break the onepage functionality. A child permalink should just load it’s parent page and add use its slug as a an #anchor in the URL.

Read more here: Automatically prepending ‘#’ to slug in child page permalinks


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , , , ,

Wordpress related questions and answers: