Skip to content

Instantly share code, notes, and snippets.

@jchristopher
Forked from anonymous/sez-content.php
Last active December 21, 2016 00:54
Show Gist options
  • Save jchristopher/7d448ac0ece10c4153450916964c6cab to your computer and use it in GitHub Desktop.
Save jchristopher/7d448ac0ece10c4153450916964c6cab to your computer and use it in GitHub Desktop.
<?php
/**
* The default template for displaying content
*
* Used for both single and index/archive/search
*
* @package Catch Themes
* @subpackage Clean Journal
* @since Clean Journal 0.1
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="archive-post-wrap">
<?php
/**
* clean_journal_before_entry_container hook
*
* @hooked clean_journal_archive_content_image - 10
*/
do_action( 'clean_journal_before_entry_container' ); ?>
<div class="entry-container">
<header class="entry-header">
<h1 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
<?php if ( 'post' == get_post_type() ) : ?>
<?php clean_journal_entry_meta(); ?>
<?php endif; ?>
</header><!-- .entry-header -->
<?php
$options = clean_journal_get_theme_options();
if ( is_search() || 'full-content' != $options['content_layout'] ) : // Only display Excerpts for Search and if 'full-content' is not selected ?>
<div class="entry-summary">
<?php
$excerpt = get_the_excerpt();
// Is SearchWP Term Highlight active?
if( function_exists( 'searchwp_term_highlight_get_the_excerpt_global' ) ) {
// Try to build an excerpt from the stored PDF content
$excerpt = searchwp_term_highlight_get_the_excerpt_global( get_the_ID(), '_searchwp_file_content', get_search_query() );
// If PDF content was empty, fall back to global excerpt
if ( empty( $excerpt ) ) {
$excerpt = searchwp_term_highlight_get_the_excerpt_global();
}
}
?>
<p><?php echo wp_kses_post( $excerpt ); ?></p>
</div><!-- .entry-summary -->
<?php else : ?>
<div class="entry-content">
<?php the_content(); ?>
<?php
wp_link_pages( array(
'before' => '<div class="page-links"><span class="pages">' . __( 'Pages:', 'clean-journal' ) . '</span>',
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>',
) );
?>
</div><!-- .entry-content -->
<?php endif; ?>
<footer class="entry-footer">
<?php clean_journal_tag_category(); ?>
</footer><!-- .entry-footer -->
</div><!-- .entry-container -->
</div><!-- .archive-post-wrap -->
</article><!-- #post -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment