<?php
/**
 * Template part for displaying single posts
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package nxt-event-planner
 */
?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    <header class="entry-header">
        <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>

        <div class="single-post-meta">
            <span class="meta-item post-date"><?php echo esc_html( get_the_date( 'M d, Y' ) ); ?></span>
            <?php if ( get_edit_post_link() ) : ?>
                <span class="meta-item post-edit-link"><?php edit_post_link( esc_html__( 'Edit', 'nxt-event-planner' ) ); ?></span>
            <?php endif; ?>
        </div>
    </header>

    <?php if ( has_post_thumbnail() ) : ?>
        <div class="entry-featured-image">
            <?php the_post_thumbnail( 'large' ); ?>
        </div>
    <?php endif; ?>

    <div class="entry-content">
        <?php
        the_content();

        wp_link_pages(
            array(
                'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'nxt-event-planner' ),
                'after'  => '</div>',
            )
        );
        ?>
    </div>

    <footer class="entry-footer">
        <?php
        $nxt_event_planner_categories_list = get_the_term_list( get_the_ID(), 'category', '', ' ' );
        if ( $nxt_event_planner_categories_list ) {
            printf(
                '<div class="tags-links"><span class="tag-label">%1$s</span>%2$s</div>',
                esc_html__( 'Categories:', 'nxt-event-planner' ),
                $nxt_event_planner_categories_list
            );
        }

        $nxt_event_planner_tags_list = get_the_tag_list();
        if ( $nxt_event_planner_tags_list ) {
            printf(
                '<div class="tags-links"><span class="tag-label">%1$s</span>%2$s</div>',
                esc_html__( 'Tags:', 'nxt-event-planner' ),
                $nxt_event_planner_tags_list
            );
        }
        ?>
    </footer>
</article>
