<?php
/**
 * Template part for displaying posts.
 *
 * @link https://codex.wordpress.org/Template_Hierarchy
 *
 * @package Theme Palace
 * @subpackage  Charity Give
 * @since  Charity Give 1.0.0
 */

$options = charity_give_get_theme_options();
?>
<article>
    <div class="post-wrapper">
        <?php if ( $options['hide_archive_post_image'] == false ) : ?>
            <div class="featured-image" style="background-image: url('<?php echo ( has_post_thumbnail( )) ? the_post_thumbnail_url( 'medium_large' ) : get_template_directory_uri().'/assets/uploads/no-featured-image-600x450.jpg' ?>');">
                <a href="<?php the_permalink(); ?>" class="post-thumbnail-link"></a>
            </div>
        <?php endif; ?>

        <div class="entry-container">
            <?php
            if( !empty( $options['hide_archive_date'] ) == false ):
                charity_give_posted_on();
            endif;
            ?>
            <?php if( !empty( $options['hide_archive_title'] ) == false ): ?>
                <header class="entry-header">
                    <h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
                </header>
            <?php endif; ?>

            <?php if( !empty( $options['hide_archive_content'] ) == false ): ?>
                <div class="entry-content">
                    <?php the_excerpt(); ?>
                </div><!-- .entry-content -->
            <?php endif; ?>

            <?php if(!empty($options['archive_btn_txt'])): ?>
            <div class="read-more">
                <a href="<?php the_permalink(); ?>" class="btn"><?php echo esc_html($options['archive_btn_txt']); ?></a>
            </div><!-- .read-more -->
            <?php endif; ?>
        </div><!-- .entry-container -->
    </div>
</article>
