%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( '' ); $string = '' . $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() { ?>
', 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() { ?> '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() ) : ?>' . $more_link . '
'; } endif; if ( ! function_exists( 'avior_related_posts' ) ) : /** * Displays related posts */ function avior_related_posts( $post ) { if ( 'post' === get_post_type() ) { $orig_post = $post; 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() ): ?>