loop not displaying posts on custom template page

Make a copy of press.php and rename it to home.php.

The page you selected “Press” to be the designated page for your posts in the dashboard under,

Settings > Reading > Posts Page: [Press]

…now falls under the control of the template hierarchy as listed by Milo.

First WordPress will look for the existence of home.php and if it exists, that will be applied as the template for your Press page.

If it does not exist, it will then move onto the default index.php and do the same.

Effectively your press.php is useless with regards to your Press page while it remains set under your Settings > Reading preferences.

Usually when creating custom themes my index.php looks something similar to,

<?php get_header(); ?>

<?php 

    if(is_home() ) {

    include 'homepage.php';

    } else {

    //do as you wish here... i.e. display normal loop etc

   } 

?>

<?php get_sidebar(); ?>

<?php get_footer(); ?>

homepage.php for example would be your custom home page, as a result you don’t need to use any of the settings in reading. This is only a very simplistic overview of something that can be done a number of ways, but just trying to give you an idea.

However for now, what you want is to be using home.php as described above.

Leave a Comment