<?php
/**
 * Template part for displaying posts on front page
 *
 *
 * @package WordPress
 * @subpackage riddle
 * @since 1.0
 * @version 1.0
 */

?>
<?php

        //$image_id = get_post_thumbnail_id();
        //$image_url = wp_get_attachment_image_src($image_id,800,800);
        //$image_url = $image_url[0]; 
        ?>
   

            <div class="post-item">
            <div class="post_hover_block">
                <div class="post-img">
                    <?php 
                    if( has_post_thumbnail() ) : ?>
                        <a  href="<?php the_permalink(); ?>" rel="bookmark">
                       <?php the_post_thumbnail(array(500, 300)); ?>
                       </a>
                    <?php else : ?>
                        <a  href="<?php the_permalink(); ?>" rel="bookmark">
                            <img width="400" height="250" src="<?php echo get_parent_theme_file_uri(); ?>/assets/images/no-img.png"/>
                        </a>
                   <?php endif;
                    ?>
                </div>
                <div class="date-body">
                    <span class="date-content">
                    <?php $date = the_date('d M Y', '<h2>', '</h5>', $echo = false); echo (str_replace(" ", '</h2><h5>', $date));?>
                    </span>
                </div>
                <h3 class="post-title">
                    <span class="accordion-title"><?php the_title();  ?></span>
                </h3>
                <div class="post_description">
                    <div class="post-body">
                    <?php riddle_excerpt(5); ?>
                    </div>
                    <span class="link-blog">
                        <a class="more-button" href="<?php the_permalink(); ?>" rel="bookmark">
                                <?php if (get_theme_mod( 'personnew_more_button' )) :
                                        echo esc_attr(get_theme_mod( 'personnew_more_button' ));
                                    else :
                                        _e('Read Now', 'personnew');
                                    endif; ?></a>
                    </span>
                </div>
                </div>
            </div>
                