
<?php
/**
 * The template for displaying content
 * Used for both single and index/archive/search.
 */
?>
<?php if ( is_single() ) { ?>
    <div class="postpage">
<?php } ?>
        <?php theguard_2_columns_v2(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    <?php if ( !is_single() ) { ?>
        <?php if ( has_post_thumbnail() && ! is_attachment() ) {
            echo '<div class="entry-thumbnail">';
                theguard_2_columns_v2_thumb();
            echo '<div class="thumbhover"><a href="'.get_the_permalink().'" class="more-link">'.esc_html('Read more','the-guard').'</a></div>
        </div>';
    }
        ?>
        <div class="c_block">
            <header class="entry-header">
                <div class="entry-meta">
                    <?php theguard_entry_meta_short(); ?>
                </div>
                <h3 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h3>
            </header><!-- .entry-header -->
    <?php } ?>



    <?php if ( is_single() ) { ?>
        <header class="entry-header">
            <?php theguard_heading_header4(); ?>
            <div class="entry-meta">
                <?php theguard_entry_meta(); ?>
                <?php edit_post_link( esc_html__( 'Edit', 'the-guard' ), '<span class="edit-link">', '</span>' ); ?>
            </div>
        </header><!-- .entry-header -->

    <?php } ?>


    <?php if ( is_search() ) : // Only display Excerpts for Search ?>
    <div class="entry-content">
        <?php the_excerpt(); ?>
    </div>
    <?php else : ?>
        <div class="entry-content">
            <?php if ( is_single()) : ?>
                <?php
                /* translators: %s: Name of current post */
                the_content( sprintf(
                    esc_html__( 'Continue reading ', 'the-guard' ), '<span class="meta-nav">&rarr;</span>',
                    the_title( '<span class="screen-reader-text">', '</span>', false )
                ) );

                wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . esc_html__( 'Pages:', 'the-guard' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) );
                ?>
            <?php else : ?>
               <?php
                // Excerpt
                sell_excerpt_length();
                ?>
               
            <?php endif; // is_single() ?>

        </div><!-- .entry-content -->
    <?php endif; ?>
            <?php if ( !is_single() ) { ?>
        </div>
<?php } ?>
</article><!-- #post -->
<?php theguard_2_columns_v2_end(); ?>
        
<?php if ( is_single() ) { ?>
    </div>
<?php } ?>
