• Resolved djmorigeau

    (@djmorigeau)


    Hello,
    I’ve been trying to run a loop pulling different post formats, but I can’t seem to get the loop to pull any other template other than content.php.

    I currently have:

    content.php
    content-quote.php
    content-image.php
    content-gallery.php

    …etc.

    The loop that I am running is located in index.php

    the loop…

    <?php if ( have_posts() ) : ?>
    <?php /* Start the Loop */ ?>
    <?php while ( have_posts() ) : the_post(); ?> 	
    
    <?php get_template_part( 'content', get_post_format() ); ?>
    
    <?php endwhile; ?>
    <?php endif; ?>

    The only problem is the content won’t pull from any of my custom format templates and I’m not sure why.

    The template content.php is a copy of content-image.php. Any ideas of what I am doing wrong?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter djmorigeau

    (@djmorigeau)

    I figured out what I was missing. I needed to add_theme_support(‘post_formats’, array(‘post format names’)) to my functions.php. The theme I was using was using a custom way of selecting different post types. This was the reason that the loop was not recognizing any of my post format templates.

    Thread Starter djmorigeau

    (@djmorigeau)

    Solved

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘All Posts Coming from content.php’ is closed to new replies.