%2$s'; if (get_the_time('U') !== get_the_modified_time('U')) { $time_string = ''; } $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( /* translators: 1: Posted on %s post date */ esc_html_x('Posted on %s', 'post date', 'elizama'), '' . $time_string . '' ); $byline = sprintf( /* translators: 1: by , post author */ esc_html_x('by %s', 'post author', 'elizama'), '' . esc_html(get_the_author()) . '' ); echo '' . $posted_on . ' ' . $byline . ''; // WPCS: XSS OK. } endif; if (!function_exists('el_entry_footer')) : /** * Prints HTML with meta information for the categories, tags and comments. */ function el_entry_footer() { // Hide category and tag text for pages. if ('post' === get_post_type()) { /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list(esc_html__(', ', 'elizama')); if ($categories_list && el_categorized_blog()) { /* translators: 1: Posted in */ printf('' . esc_html__('Posted in %1$s', 'elizama') . '', $categories_list); // WPCS: XSS OK. } /* translators: used between list items, there is a space after the comma */ $tags_list = get_the_tag_list('', esc_html__(', ', 'elizama')); if ($tags_list) { /* translators: 1: Tagged */ printf('' . esc_html__('Tagged %1$s', 'elizama') . '', $tags_list); // WPCS: XSS OK. } } if (!is_single() && !post_password_required() && ( comments_open() || get_comments_number() )) { echo ''; comments_popup_link(esc_html__('Leave a comment', 'elizama'), esc_html__('1 Comment', 'elizama'), esc_html__('% Comments', 'elizama')); echo ''; } edit_post_link(esc_html__('Edit', 'elizama'), '', ''); } endif; /** * Returns true if a blog has more than 1 category. * * @return bool */ function el_categorized_blog() { if (false === ( $all_the_cool_cats = get_transient('el_categories') )) { // Create an array of all the categories that are attached to posts. $all_the_cool_cats = get_categories(array( 'fields' => 'ids', 'hide_empty' => 1, // We only need to know if there is more than one category. 'number' => 2, )); // Count the number of categories that are attached to the posts. $all_the_cool_cats = count($all_the_cool_cats); set_transient('el_categories', $all_the_cool_cats); } if ($all_the_cool_cats > 1) { // This blog has more than 1 category so el_categorized_blog should return true. return true; } else { // This blog has only 1 category so el_categorized_blog should return false. return false; } } function el_pagination( $mid = 2, $end = 1, $show = false, $query = null ) { // Prevent show pagination number if Infinite Scroll of JetPack is active. if ( ! isset( $_GET[ 'infinity' ] ) ) { global $wp_query, $wp_rewrite; $total_pages = $wp_query->max_num_pages; if ( is_object( $query ) && null != $query ) { $total_pages = $query->max_num_pages; } if ( $total_pages > 1 ) { $url_base = $wp_rewrite->pagination_base; $big = 999999999; // Sets the paginate_links arguments. $arguments = apply_filters( 'el_pagination_args', array( 'base' => esc_url_raw( str_replace( $big, '%#%', get_pagenum_link( $big, false ) ) ), 'format' => '', 'current' => max( 1, get_query_var( 'paged' ) ), 'total' => $total_pages, 'show_all' => $show, 'end_size' => $end, 'mid_size' => $mid, 'type' => 'list', 'prev_text' => __( '« Previous', 'elizama' ), 'next_text' => __( 'Next »', 'elizama' ), ) ); $pagination = '
' . paginate_links( $arguments ) . '
'; // Prevents duplicate bars in the middle of the url. if ( $url_base ) { $pagination = str_replace( '//' . $url_base . '/', '/' . $url_base . '/', $pagination ); } echo ($pagination); } } } if ( ! function_exists( 'el_paging_nav' ) ) { /** * Print HTML with meta information for the current post-date/time and author. * * @since 2.2.0 */ function el_paging_nav() { $mid = 2; // Total of items that will show along with the current page. $end = 1; // Total of items displayed for the last few pages. $show = false; // Show all items. return el_pagination( $mid, $end, $show ); } } if ( ! function_exists( 'k7themes_ecommerce_post_thumbnail' ) ) : /** * Displays an optional post thumbnail. * * Wraps the post thumbnail in an anchor element on index views, or a div * element when on single views. */ function k7themes_ecommerce_post_thumbnail() { if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { return; } if ( is_singular() ) : ?>