<?php
/**
 * Custom template tags for this theme.
 *
 * Eventually, some of the functionality here could be replaced by core features.
 *
 * @package bestel
 */
if (!function_exists('bestel_posted_on')) :

    /**
     * Prints HTML with meta information for the current post-date/time and author.
     */
    function bestel_posted_on_by() {
       // $bestel = bestel_options();
        $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
        if (get_the_time('U') !== get_the_modified_time('U')) {
            $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
        }
        $time_string = sprintf(
            $time_string,
            esc_attr(get_the_date('c')),
            esc_html(get_the_date()),
            esc_attr(get_the_modified_date('c')),
            esc_html(get_the_modified_date())
        );
        $posted_on = sprintf(
                esc_html_x(' %s', 'post date', 'bestel'), '<a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a>'
        );
        echo '<div class="post-meta">';
        echo '<div  class="date">' . $posted_on . '</div>'; // WPCS: XSS OK.
        echo '<div class="reviews"><i class="icon-quote"></i><span>';
        comments_number('0', '1', '%');
        echo '</span></div>';
        echo '</div>';
    }

endif;
if (!function_exists('bestel_posted_on_by')) :
    /**
     * Prints HTML with meta information for the current post-date/time and author.
     */
    function bestel_posted_on_by() {
        $byline = sprintf(
                esc_html_x('by %s', 'post author', 'bestel'), '<span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' . esc_html(get_the_author()) . '</a></span>'
        );
        echo '<div class="post-author">' . $byline . '</div>';
    }
endif;