Skip to content

Code Snippet: WordPress Page Template Redirect to child page

Blog  ✺  WordPress  ✺  Code Snippet

Sometimes you need a simple way to redirect a parent page directly to it’s first child page in WordPress. This little snippet is a WordPress page template to be used in your theme. It includes support for WPML, in case you still use my least favorite translation plugin in the universe. I strongly suggest you use something like Polylangor Multilingual Press to create multilingual WordPress sites, but that’s material for another post.

Page Template

Create a custom page template using the code below.

Comments

You might like

WordPress Mega Menu with Blocks

WordPress

Building a custom driver for Favicon Fetcher

Laravel