• Hi,

    I am building a site using sub-pages so I can target them for css styling, however the resulting url is too long, ie https://mysite.com/parent-page/child-page.

    I would prefer to have htpp://mysite.com/child-page.

    I’ve looked a the wp rewrite rules but it’s not going in.

    Has anyone done this, and what was your solution. I’d rather not go the plugin route. I was hoping for soming in .htaccess file or the functions.php file.

    Thanks in advance for any pointers.
    Cheers,
    Tracy

Viewing 2 replies - 1 through 2 (of 2 total)
  • To have that url structure you will need to child page to not have a parent.

    You can just have the child page without a parent and in you menu still have it as subpage.

    Thread Starter Freelancealot

    (@freelancealot)

    Thanks Alexander, but I wanted to use the class ‘parent-pageid-xx’ to style all the child pages.

    I’m having a mental block. I need to style the child pages differently to the parent page, but I don’t want to get into custom post types, so thought the parent-pageid-xx class was a good way around it.

    Any suggestions welcome.

    Cheers,
    Tracy

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to Rewrite permalink for child pages’ is closed to new replies.