Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: v1.1
Fetching contributors…

Cannot retrieve contributors at this time

77 lines (59 sloc) 3.192 kb
<?php
/**
* The template for displaying recent posts in the template-front-page.php page template
* @package Cakifo
* @subpackage Template
*/
?>
<?php do_atomic( 'before_recent_posts' ); // cakifo_before_recent_posts ?>
<section id="recent-posts" class="clearfix">
<?php do_atomic( 'open_recent_posts' ); // cakifo_open_recent_posts ?>
<h3 class="section-title"><?php _e( 'Recent Posts', hybrid_get_textdomain() ); ?></h3>
<?php
// Display our recent posts, ignoring Aside, Link, Quote and Status posts
$recent_args = array(
'showposts' => 4,
'ignore_sticky_posts' => 1,
'order' => 'DESC',
'tax_query' => array( array(
'taxonomy' => 'post_format',
'terms' => array( 'post-format-aside', 'post-format-link', 'post-format-quote', 'post-format-status' ),
'field' => 'slug',
'operator' => 'NOT IN',
),
),
);
// Our query for the Recent Posts section
$recent = new WP_Query();
$recent->query( $recent_args );
$i = 0;
while ( $recent->have_posts() ) : $recent->the_post();
$GLOBALS['cakifo_do_not_duplicate'][] = $post->ID; // Put the post ID in an array to make sure it's only showing once (this array is used in the headline lists as well)
?>
<article class="recent-post">
<?php do_atomic( 'open_recent_posts_item' ); // cakifo_open_recent_posts_item ?>
<?php if ( current_theme_supports( 'get-the-image' ) ) { ?>
<div class="image">
<?php
get_the_image( array(
'meta_key' => 'Thumbnail',
'size' => 'recent',
'image_class' => 'thumbnail',
'default_image' => THEME_URI . '/images/default-thumb-190-130.gif'
) );
?>
</div>
<?php } ?>
<div class="details">
<h4><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" rel="bookmark"><?php the_title(); ?></a></h4>
<?php echo apply_atomic_shortcode( 'headline_meta', '<span class="headline-meta">' . __( '[entry-published] by [entry-author]', hybrid_get_textdomain() ) . '</span>' ); ?>
<div class="entry-summary">
<?php cakifo_the_excerpt( 20 ); ?>
</div>
</div> <!-- .details -->
<?php do_atomic( 'close_recent_posts_item' ); // cakifo_close_recent_posts_item ?>
</article>
<?php endwhile; wp_reset_query(); ?>
<?php do_atomic( 'close_recent_posts' ); // cakifo_close_recent_posts ?>
</section> <!-- #recent-posts -->
<?php do_atomic( 'after_recent_posts' ); // cakifo_after_recent_posts ?>
Jump to Line
Something went wrong with that request. Please try again.