<?php
/**
 *  The template partial for displaying single blog post content
 *
 *
 * @package Felicityhealth
 * @since Felicityhealth 1.0
 */
?>

<div id="post-<?php the_ID(); ?>" <?php post_class('col-md-9 mb-3'); ?>>
    <div class="zulu-post-header">
        <?php if ( has_post_thumbnail() ): // check if the post has a Post Thumbnail assigned to it.?>
        <div class="zulu-post-thumbnail">
            <?php 
                echo get_the_post_thumbnail($post->ID, '', array('title' => the_title_attribute( array( 'echo' => 0 ) ), 'alt' => the_title_attribute( array( 'echo' => 0 ) )));
                ?>
        </div>
        <?php else:?>
        <div class="zulu-post-thumbnail">
            <a href="<?= esc_url( get_permalink() )?>">
                <svg class="bd-placeholder-img card-img-top" width="100%" height="225"
                    xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid slice" focusable="false" role="img"
                    aria-label="Placeholder: <?php the_title(); ?>">
                    <title><?php the_title(); ?></title>
                    <rect width="100%" height="100%" fill="#55595c"></rect><text x="50%" y="50%" fill="#eceeef"
                        dy=".3em"><?php the_title(); ?></text>
                </svg>

            </a>
        </div>
        <?php endif?>
        <h1><?php the_title(); ?></h1>
        <div class="zulu-post-meta border-bottom pb-2"> <span><em> <?php _e( 'By', 'zulured' ); ?> <a
                        href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"
                        title="<?php _e( 'Posts by', 'zulured' ); ?> <?php echo get_the_author(); ?>"
                        rel="author"><?php echo get_the_author(); ?></a> </em><time><?php _e( 'on', 'zulured' ); ?>
                    <?php echo get_the_date('F j, Y'); ?></time></span>
        </div>
    </div>
    <article>
        <div>
            <?php
            if( '' !== get_post()->post_content ) {
                the_content( __( 'Continue reading', 'zulured' ) );
            } else {
                echo __( 'No content for this post', 'zulured' ) ;
            }
            ?>
        </div>

    </article>

    <div class="zulu-single-post-meta"><?php _e( 'Posted in ', 'zulured' ); ?>
        <?php
       
    if (has_category() ) { ?>
        <span class="screen-reader-text"><?php _e( 'Categories', 'zulured' ); ?></span>
        <?php the_category( ', ' );?>
        <?php }?>
        <?php if ( has_tag() ) { ?>
        <?php _e( 'and  tagged', 'zulured' ); ?>
        <?php the_tags( ', ' ); ?>
        <?php }?>.</div>
</div>