Post formats and template hierarchy

It is easy to make this work if your theme don’t support post formats

  • Create a child theme

  • add_theme_support for post formats

  • Remove the loop from your template files and add replace it with get_template_part( 'content', get_post_format() );. Your template should look like this

    if ( have_posts() ) { // <- Not necessary in single.php
    
        while ( have_posts() ) {
            the_post();
    
            get_template_part( 'content', get_post_format() );
    
        }
    
    }
    
  • Everything else should go into a new file which should be called content.php

  • Create a new file called content-image.php and add the loop in there and modify as needed

  • When a post is assigned the image post format, content-image.php will be used inside single.php to display the image posts

Look at one of the bundled themes how to exactly make use of post formats