Skip to content

Code Snippet: WordPress Page Template Redirect to child page

Writing  ✺  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.

You might like

Code Snippet: Remove Jetpack Related Posts from Woo Testimonials

Improve your conversions with 100 “Hot Tips” 🔥 for your Landing Pages