%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 = '' . esc_html( get_the_author() ) . ''; echo '' . $posted_on . ' ' . $byline . ''; if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { echo ''; comments_popup_link( __( 'Leave a comment', 'coral-parallax' ), __( '1 Comment', 'coral-parallax' ), __( '% Comments', 'coral-parallax' ) ); echo ''; } edit_post_link( __( 'Edit', 'coral-parallax' ), '', '' ); } endif; if ( ! function_exists( 'coral_parallax_entry_footer' ) ) : /** * Prints HTML with meta information for the categories, tags and comments. */ function coral_parallax_entry_footer() { // Hide category and tag text for pages. if ( 'post' == get_post_type() ) { if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string = ''; $time_string = sprintf( $time_string, esc_attr( get_the_modified_date( 'c' ) ), esc_html( get_the_modified_date() ) ); $posted_on = '' . $time_string . ''; printf( '' . __( 'Updated: %1$s', 'coral-parallax' ) . '
', $posted_on ); } if (is_rtl()) { $categories_list = get_the_category_list(); if ( $categories_list && coral_parallax_categorized_blog() ) { echo '' . __( 'Categories:', 'coral-parallax' ) . '' . $categories_list ; } $tags_list = get_the_tag_list( '' ); if ( $tags_list ) { echo '' . __( 'Tags:', 'coral-parallax' ) . '' . $tags_list ; } } else { /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list( __( ', ', 'coral-parallax' ) ); if ( $categories_list && coral_parallax_categorized_blog() ) { printf( '' . __( 'Categories: %1$s', 'coral-parallax' ) . '', $categories_list ); } /* translators: used between list items, there is a space after the comma */ $tags_list = get_the_tag_list( '', __( ', ', 'coral-parallax' ) ); if ( $tags_list ) { printf( '' . __( 'Tags: %1$s', 'coral-parallax' ) . '', $tags_list ); } } } } endif; /** * Returns true if a blog has more than 1 category. * * @return bool */ function coral_parallax_categorized_blog() { if ( false === ( $all_the_cool_cats = get_transient( 'coral_parallax_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( 'coral_parallax_categories', $all_the_cool_cats ); } if ( $all_the_cool_cats > 1 ) { // This blog has more than 1 category so coral_parallax_categorized_blog should return true. return true; } else { // This blog has only 1 category so coral_parallax_categorized_blog should return false. return false; } } /** * Flush out the transients used in coral_parallax_categorized_blog. */ function coral_parallax_category_transient_flusher() { if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { return; } // Like, beat it. Dig? delete_transient( 'coral_parallax_categories' ); } add_action( 'edit_category', 'coral_parallax_category_transient_flusher' ); add_action( 'save_post', 'coral_parallax_category_transient_flusher' ); if ( ! function_exists( 'coral_parallax_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. * * Create your own coral_parallax_post_thumbnail() function to override in a child theme. * */ function coral_parallax_post_thumbnail() { if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { return; } if ( is_singular() ) : ?>