<?php

/**
 * Template part for displaying the content of a page (used in page.php).
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package cleanlogic
 */
?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

    <header class="entry-header">
        <?php
        // Display the page title
        the_title('<h1 class="entry-title"><a href="' . esc_url(get_permalink()) . '" rel="bookmark">', '</a></h1>');
        ?>
        <?php if (has_post_thumbnail()) : ?>
            <?php $thumb_title = the_title_attribute(array('echo' => false)); ?>
            <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr($thumb_title); ?>">
                <?php the_post_thumbnail(); ?>
            </a>
        <?php endif; ?>

        <?php cleanlogic_posted_on(); ?>

    </header><!-- .entry-header -->

    <div class="entry-content">
        <?php

        if (is_singular()) {
            the_content();

            wp_link_pages(array(
                'before' => '<div class="page-links">' . esc_html__('Pages:', 'cleanlogic'),
                'after'  => '</div>',
            ));
        } else {
            cleanlogic_teaser();

            wp_link_pages(array(
                'before' => '<div class="page-links">' . esc_html__('Pages:', 'cleanlogic'),
                'after'  => '</div>',
            ));
        }
        
        ?>
    </div><!-- .entry-content -->

    <footer class="entry-footer">
        <?php
        edit_post_link(
            sprintf(
                /* translators: %s: Post title for the edit link (screen-reader text). */
                esc_html__('Edit %s', 'cleanlogic'),
                '<span class="screen-reader-text">"' . esc_html(get_the_title()) . '"</span>'
            ),
            '<span class="edit-link">',
            '</span>'
        );
        ?>
    </footer>

</article><!-- #post-## -->