Last active
December 21, 2019 00:49
-
-
Save dmtrmrv/f5699021e7d685779479d6952f7625bb to your computer and use it in GitHub Desktop.
Conditional Excerpt for Integer Theme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The default template used for displaying post content in index.php. | |
* | |
* @package Integer | |
*/ | |
?> | |
<article id="post-<?php the_ID(); ?>" <?php post_class( 'blogroll-item' ); ?>> | |
<?php integer_post_thumbnail_archive(); ?> | |
<header class="blogroll-item__header"> | |
<?php the_title( sprintf( '<h2 class="blogroll-item__title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?> | |
</header><!-- .blogroll-item__header --> | |
<?php integer_entry_meta_index(); ?> | |
<div class="blogroll-item__content"> | |
<?php | |
if ( has_excerpt() ) { | |
the_excerpt(); | |
printf( | |
'<a href="%s" class="">%s</a>', | |
esc_url( get_permalink() ), | |
sprintf( __( 'Continue reading %s', 'integer' ), the_title( '<span class="screen-reader-text">"', '"</span>', false ) ) | |
); | |
} else { | |
// Translators: %s is the title of the post. | |
the_content( sprintf( __( 'Continue reading %s', 'integer' ), the_title( '<span class="screen-reader-text">"', '"</span>', false ) ) ); | |
} | |
?> | |
<?php | |
wp_link_pages( array( | |
'before' => '<div class="page-links">' . __( 'Pages:', 'integer' ), | |
'after' => '</div>', | |
) ); | |
?> | |
</div><!-- .blogroll-item__content --> | |
</article><!-- #post-## --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment