Custom Loop – Get Post Format
-
Hi,
I’ve created a custom loop template for the purpose of displaying the posts in various grid layouts. But I’m not sure how to specify the Post Format ie standard, quote, link, image.
The standard post loop (index.php) which works to pull in the post format looks like this..
<?php if ( have_posts() ) : ?> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?> <?php else : ?> <?php get_template_part( 'content', 'none' ); ?> <?php endif; ?>
The custom one I’ve put together works like this…
<div class="six columns"> <?php if ( have_posts() ) : ?> <?php while ( have_posts() ) : the_post(); ?> <a href="<?php the_permalink() ?>" > <?php the_post_thumbnail('the-hub-image', array('class' => 'alignleft')); ?></a> <h2 class="postTitle"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
… and goes on to specify the other features/layout I need.
Is there any way to include the
get_post_format
in this custom layout loop in order to load the various different layout styles for post formats which aren’t marked as ‘standard’ post?Many thanks in advance to any replies!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Custom Loop – Get Post Format’ is closed to new replies.