How do I display child post types in the parent post type template

After some digging I found the answer! Hopefully this helps some other people! EDIT Improved Answer! <?php $args = array( ‘post_parent’ => get_the_ID(), ‘post_type’ => ‘airports’, ‘posts_per_page’ => -1 ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); ?> <h2><?php the_title(); ?></h2> <a href=”https://wordpress.stackexchange.com/questions/222748/<?php the_permalink(); ?>”> <button><?php _e(‘View’, ‘text_domain’); ?></button> </a> … Read more

WP_Query with multiple orderby NOT working with ASC and DESC, what’s wrong?

Your code is invalid (syntax error, missing closing array and semi-colon), and incorrectly nested – if you were to properly indent your code, you’d have something like: $args = array( ‘tag’ => ‘tag-AAA,tag-BBB’, array ( ‘orderby’ => array( ‘title’ => ‘ASC’, ‘post_date’ => ‘DESC’, ) ), ); See how orderby isn’t actually a property of … Read more

Where to put custom page templates in theme?

Where to put custom page templates in theme? Custom page templates in page-templates folder are automatically recognized by WordPress.This folder is recommended for global or multi-purpose page-templates. You can check more organizing theme files on theme development handbook. but it does not work with my theme? Are you sure you have template files with the … Read more

Blog page wont use blog-template.php

The page you set as the “page for posts” is really a placeholder, allowing you to access the blog with that “Page’s” permalink, but not displaying it as a WordPress Page and so not pulling in the custom template. The theme’s home.php template will be used for the blog main page, so put your code … Read more