Skip to content

Instantly share code, notes, and snippets.

@congthien
Created March 22, 2017 05:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save congthien/073030699c5c61ee4d5f0ae12a4e5433 to your computer and use it in GitHub Desktop.
Save congthien/073030699c5c61ee4d5f0ae12a4e5433 to your computer and use it in GitHub Desktop.
<?php
/**
* Template part for displaying posts.
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package OnePress
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class( array('list-article', 'clearfix') ); ?>>
<div class="list-article-thumb">
<a href="<?php echo esc_url( get_permalink() ); ?>">
<?php
if ( has_post_thumbnail( ) ) {
the_post_thumbnail( 'onepress-blog-small' );
} else {
echo '<img alt="" src="'. get_template_directory_uri() . '/assets/images/placholder2.png' .'">';
}
?>
</a>
</div>
<div class="list-article-content">
<div class="list-article-meta">
<?php the_category(' / '); ?>
<?php echo ' - on '.get_the_date() ?>
</div>
<header class="entry-header">
<?php the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>
</header><!-- .entry-header -->
<div class="entry-excerpt">
<?php
the_excerpt();
?>
<?php
wp_link_pages( array(
'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'onepress' ),
'after' => '</div>',
) );
?>
</div><!-- .entry-content -->
</div>
</article><!-- #post-## -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment