<?php
/**
* Template part for displaying single posts.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package EliteWP WordPress Theme
* @copyright Copyright (C) 2025 ThemesDNA
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
* @author ThemesDNA <themesdna@gmail.com>
*/
?>

<?php elitewp_before_single_post(); ?>

<article id="post-<?php the_ID(); ?>" <?php post_class('elitewp-post-singular elitewp-box'); ?>>
<div class="elitewp-box-inside">

    <?php elitewp_before_single_post_title(); ?>

    <header class="entry-header">
        <?php the_title( sprintf( '<h1 class="post-title entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h1>' ); ?>
    </header><!-- .entry-header -->

    <?php elitewp_after_single_post_title(); ?>

    <div class="entry-content clearfix">
            <?php
            if ( has_post_thumbnail() ) {
                if ( !(elitewp_get_option('hide_thumbnail')) ) {
                    if ( !(elitewp_get_option('hide_thumbnail_single')) ) {
                        if ( elitewp_get_option('thumbnail_link') == 'no' ) {
                            if ( is_page_template( array( 'template-full-width-post.php' ) ) ) {
                                the_post_thumbnail('elitewp-large-image', array('class' => 'elitewp-post-thumbnail-single'));
                            } else {
                                the_post_thumbnail('elitewp-featured-hauto-image', array('class' => 'elitewp-post-thumbnail-single'));
                            }
                        } else { ?>
                            <?php if ( is_page_template( array( 'template-full-width-post.php' ) ) ) { ?>
                                <a href="<?php echo esc_url( get_permalink() ); ?>" title="<?php /* translators: %s: post title. */ echo esc_attr( sprintf( __( 'Permanent Link to %s', 'elitewp' ), the_title_attribute( 'echo=0' ) ) ); ?>"><?php the_post_thumbnail('elitewp-large-image', array('class' => 'elitewp-post-thumbnail-single')); ?></a>
                            <?php } else { ?>
                                <a href="<?php echo esc_url( get_permalink() ); ?>" title="<?php /* translators: %s: post title. */ echo esc_attr( sprintf( __( 'Permanent Link to %s', 'elitewp' ), the_title_attribute( 'echo=0' ) ) ); ?>"><?php the_post_thumbnail('elitewp-featured-hauto-image', array('class' => 'elitewp-post-thumbnail-single')); ?></a>
                            <?php } ?>
                <?php   }
                    }
                }
            }

            the_content( sprintf(
                wp_kses(
                    /* translators: %s: Name of current post. Only visible to screen readers */
                    __( 'Continue reading<span class="screen-reader-text"> "%s"</span> <span class="meta-nav">&rarr;</span>', 'elitewp' ),
                    array(
                        'span' => array(
                            'class' => array(),
                        ),
                    )
                ),
                get_the_title()
            ) );

            wp_link_pages( array(
             'before'      => '<div class="page-links"><span class="page-links-title">' . esc_html__( 'Pages:', 'elitewp' ) . '</span>',
             'after'       => '</div>',
             'link_before' => '<span>',
             'link_after'  => '</span>',
             ) );
             ?>
    </div><!-- .entry-content -->

    <?php elitewp_after_single_post_content(); ?>

</div>
</article>

<?php elitewp_after_single_post(); ?>