Conditionally display content before posts (e.g. sub-nav menu for child pages of parent)?

Hi everyone,

Not pushed as to whether it makes more sense to implement this via a plugin or custom PHP coding (I’m guessing the latter). But here’s approx what I’m trying to do:

For every child of a parent, I’d like to display a few blocks (ie, a pattern) before the start of the post content loop.

The blocks would consist of a sub-menu (for navigation) and a title for the section of the website.

What’s the best way to implement this?


This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer