<?php
/**
* Template part for displaying posts.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package BoldWP 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>
*/
?>

<div id="post-<?php the_ID(); ?>" class="boldwp-post-singular boldwp-box">
<div class="boldwp-box-inside">

    <header class="entry-header">
    <div class="entry-header-inside">
        <?php if ( !(boldwp_get_option('hide_post_categories_home')) ) { ?>
            <?php if ( 'post' == get_post_type() ) {
                /* translators: used between list items, there is a space */
                $categories_list = get_the_category_list( esc_html__( ', ', 'boldwp' ) );
                if ( $categories_list ) {
                    /* translators: 1: list of categories. */
                    printf( '<div class="boldwp-entry-meta-single boldwp-entry-meta-single-top"><span class="boldwp-entry-meta-single-cats"><i class="far fa-folder-open" aria-hidden="true"></i>&nbsp;' . __( '<span class="boldwp-sr-only">Posted in </span>%1$s', 'boldwp' ) . '</span></div>', $categories_list ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
                }
            } ?>
        <?php } ?>

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

        <?php if ( !(boldwp_get_option('hide_post_author_home')) || !(boldwp_get_option('hide_posted_date_home')) || !(boldwp_get_option('hide_comments_link_home')) ) { ?>
        <div class="boldwp-entry-meta-single">
        <?php if ( !(boldwp_get_option('hide_post_author_home')) ) { ?><span class="boldwp-entry-meta-single-author"><i class="far fa-user-circle" aria-hidden="true"></i>&nbsp;<a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>"><?php echo esc_html( get_the_author() ); ?></a></span><?php } ?>
        <?php if ( !(boldwp_get_option('hide_posted_date_home')) ) { ?><span class="boldwp-entry-meta-single-date"><i class="far fa-clock" aria-hidden="true"></i>&nbsp;<?php echo esc_html( get_the_date() ); ?></span><?php } ?>
        <?php if ( !(boldwp_get_option('hide_comments_link_home')) ) { ?><?php if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) { ?><span class="boldwp-entry-meta-single-comments"><i class="far fa-comments" aria-hidden="true"></i>&nbsp;<?php comments_popup_link( sprintf( wp_kses( /* translators: %s: post title */ __( 'Leave a Comment<span class="boldwp-sr-only"> on %s</span>', 'boldwp' ), array( 'span' => array( 'class' => array(), ), ) ), wp_kses_post( get_the_title() ) ) ); ?></span>
        <?php } ?><?php } ?>
        </div>
        <?php } ?>
    </div>
    </header><!-- .entry-header -->

    <div class="entry-content boldwp-clearfix">
    <?php if ( !(boldwp_get_option('hide_thumbnail_home')) ) { ?>
    <?php if ( has_post_thumbnail() ) { ?>
        <div class="boldwp-fp09-post-thumbnail boldwp-fp-post-thumbnail">
            <a href="<?php echo esc_url( get_permalink() ); ?>" title="<?php /* translators: %s: post title. */ echo esc_attr( sprintf( __( 'Permanent Link to %s', 'boldwp' ), the_title_attribute( 'echo=0' ) ) ); ?>" class="boldwp-fp09-post-thumbnail-link boldwp-fp-post-thumbnail-link"><?php the_post_thumbnail('boldwp-750w-450h-image', array('class' => 'boldwp-fp09-post-thumbnail-img boldwp-fp-post-thumbnail-img', 'title' => the_title_attribute('echo=0'))); ?></a>
        </div>
    <?php } ?>
    <?php } ?>

    <?php
    if ( !(boldwp_get_option('display_full_post_content')) ) { ?>
        <div class="boldwp-text-center"><?php the_excerpt(); ?></div>
    <?php } else {
        the_content( sprintf(
            wp_kses(
                /* translators: %s: Name of current post. Only visible to screen readers */
                __( 'Continue reading<span class="boldwp-sr-only"> "%s"</span> <span class="meta-nav">&rarr;</span>', 'boldwp' ),
                array(
                    'span' => array(
                        'class' => array(),
                    ),
                )
            ),
            wp_kses_post( get_the_title() )
        ) );

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

    <?php if ( !(boldwp_get_option('hide_post_tags_home')) ) { ?>
    <footer class="entry-footer">
    <?php boldwp_post_tags(); ?>
    </footer><!-- .entry-footer -->
    <?php } ?>

    <?php if ( !(boldwp_get_option('display_full_post_content')) ) { ?><?php if ( !(boldwp_get_option('hide_read_more_button')) ) { ?><div class="boldwp-fp09-post-read-more boldwp-fp-post-read-more"><a href="<?php echo esc_url( get_permalink() ); ?>"><?php echo esc_html( boldwp_read_more_text() ); ?><span class="boldwp-sr-only"> <?php echo wp_kses_post( get_the_title() ); ?></span></a></div><?php } ?><?php } ?>

</div>
</div>