%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 = '' . $time_string . ''; $byline = sprintf( '' . esc_html(get_the_author()) . '' ); $string = ' ' . $byline . '' . $posted_on . ''; // WPCS: XSS OK. return $string; } endif; if (!function_exists('avior_posted_on')) : /** * Prints HTML with meta information for the current post-date/time, author, categories. */ function avior_posted_on($short = false) { global $post; ?> on %2$s', '%1$s Comments on %2$s', $number, 'avior'), array('span' => array('class' => array()))); $title = get_the_title(); echo ''; comments_popup_link(sprintf(wp_kses(__('Leave a comment on %s', 'avior'), array('span' => array('class' => array()))), $title), sprintf(wp_kses(__('1 Comment on %s', 'avior'), array('span' => array('class' => array()))), $title), sprintf($more, number_format_i18n($number), $title)); echo ''; } if ('post' === get_post_type()) { /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list(' '); if ($categories_list && avior_categorized_blog()) { printf('%1$s', $categories_list); // WPCS: XSS OK. } } } } endif; if (!function_exists('avior_entry_meta')) : /** * Prints HTML with meta information for the categories, tags and comments. */ function avior_entry_meta() { ?>
"', '"', false) ), '', '' ); ?>
%1$s %2$s %3$s

', esc_html__('Tagged: ', 'avior'), esc_html_x('Tags', 'Used before tag names.', 'avior'), $tags_list ); } } } endif; if (!function_exists('avior_entry_footer')) : /** * Prints HTML with meta information. */ function avior_entry_footer() { ?>
"', '"', false) ), '', '' ); ?>
'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('avior_categories', $all_the_cool_cats); } if ($all_the_cool_cats > 1) { // This blog has more than 1 category so avior_categorized_blog should return true. return true; } else { // This blog has only 1 category so avior_categorized_blog should return false. return false; } } /** * Flush out the transients used in avior_categorized_blog. */ function avior_category_transient_flusher() { if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { return; } // Like, beat it. Dig? delete_transient('avior_categories'); } add_action('edit_category', 'avior_category_transient_flusher'); add_action('save_post', 'avior_category_transient_flusher'); if (!function_exists('avior_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 avior_post_thumbnail() { if (post_password_required() || is_attachment() || !has_post_thumbnail()) { return; } if (is_singular()) : ?>
'', 'prev_text' => '' )); } endif; if (!function_exists('avior_the_posts_pagination')) : /** * Displays the post pagination. */ function avior_the_posts_pagination() { the_posts_pagination(array( 'before_page_number' => '' . esc_html__('Page', 'avior') . ' ', 'mid_size' => 2, )); } endif; if (!function_exists('avior_excerpt')) : /** * Displays the optional excerpt. * * Wraps the excerpt in a div element. * * Create your own avior_excerpt() function to override in a child theme. * * @param string $class Optional. Class string of the div element. Defaults to 'entry-summary'. */ function avior_excerpt($class = 'entry-summary') { $class = esc_attr($class); $excerpt = get_the_excerpt(); if (!empty($excerpt)) { ?>
%2$s', esc_url(get_permalink(get_the_ID())), /* translators: %s: Name of current post */ sprintf(wp_kses(__('Continue reading "%s"', 'avior'), array('span' => array('class' => array()))), get_the_title(get_the_ID())) ); return ' … ' . $link; } endif; add_filter('excerpt_more', 'avior_excerpt_more'); if (!function_exists('avior_read_more')) : /** * Create your own avior_read_more() function to override in a child theme. */ function avior_read_more($more_link, $more_link_text) { return '

' . $more_link . '

'; } endif; if (!function_exists('avior_related_posts')) : /** * Displays related posts */ function avior_related_posts($post) { if ('post' === get_post_type()) { global $post; $tags = wp_get_post_tags($post->ID); if ($tags) { $tag_ids = array(); foreach ($tags as $individual_tag) { $tag_ids[] = $individual_tag->term_id; } $args = array( 'tag__in' => $tag_ids, 'post__not_in' => array($post->ID), 'posts_per_page' => 4 ); $my_query = new wp_query($args); if ($my_query->have_posts()): ?>