By %s', 'cleanportfolio' ), '' . get_the_author() . '' ); // Finally, let's write all of this to the page. echo ' ' . $byline . ' ' . cleanportfolio_time_link() . ''; } endif; if ( ! function_exists( 'cleanportfolio_time_link' ) ) : /** * Gets a nicely formatted string for the published date. */ function cleanportfolio_time_link() { $time_string = ''; if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string = ''; } $time_string = sprintf( $time_string, get_the_date( DATE_W3C ), get_the_date( 'M j, Y' ), get_the_modified_date( DATE_W3C ), get_the_modified_date() ); // Wrap the time string in a link, and preface it with 'Posted on'. return sprintf( /* translators: %s: post date */ __( 'Posted on %s', 'cleanportfolio' ), '' . $time_string . '' ); } endif; if ( ! function_exists( 'cleanportfolio_entry_footer' ) ) : /** * Prints HTML with meta information for the categories, tags and comments. */ function cleanportfolio_entry_footer() { /* translators: used between list items, there is a space after the comma */ $separate_meta = esc_html__( ', ', 'cleanportfolio' ); // Get Categories for posts. $categories_list = get_the_category_list( $separate_meta ); // Get Tags for posts. $tags_list = get_the_tag_list( '', $separate_meta ); // We don't want to output .entry-footer if it will be empty, so make sure its not. if ( ( ( cleanportfolio_categorized_blog() && $categories_list ) || $tags_list ) || get_edit_post_link() ) { echo ' '; } } endif; if ( ! function_exists( 'cleanportfolio_edit_link' ) ) : /** * Returns an accessibility-friendly link to edit a post or page. * * This also gives us a little context about what exactly we're editing * (post or page?) so that users understand a bit more where they are in terms * of the template hierarchy and their content. Helpful when/if the single-page * layout with multiple posts/pages shown gets confusing. */ function cleanportfolio_edit_link() { $link = edit_post_link( sprintf( /* translators: %s: Name of current post */ __( 'Edit "%s"', 'cleanportfolio' ), get_the_title() ), '', '' ); return $link; } endif; /** * Returns true if a blog has more than 1 category. * * @return bool */ function cleanportfolio_categorized_blog() { $category_count = get_transient( 'cleanportfolio_categories' ); if ( false === $category_count ) { // Create an array of all the categories that are attached to posts. $categories = 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. $category_count = count( $categories ); set_transient( 'cleanportfolio_categories', $category_count ); } return $category_count > 1; } /** * Flush out the transients used in cleanportfolio_categorized_blog. */ function cleanportfolio_category_transient_flusher() { if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { return; } // Like, beat it. Dig? delete_transient( 'cleanportfolio_categories' ); } add_action( 'edit_category', 'cleanportfolio_category_transient_flusher' ); add_action( 'save_post', 'cleanportfolio_category_transient_flusher' ); if ( ! function_exists( 'cleanportfolio_entry_footer' ) ) : /** * Prints HTML with meta information for the categories, tags and comments. */ function cleanportfolio_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 */ $tags_list = get_the_tag_list( '', esc_html__( ', ', 'cleanportfolio' ) ); if ( $tags_list ) { printf( '' . esc_html__( 'Tagged %1$s', 'cleanportfolio' ) . '', $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', 'cleanportfolio' ), esc_html__( '1 Comment', 'cleanportfolio' ), esc_html__( '% Comments', 'cleanportfolio' ) ); echo ''; } edit_post_link( sprintf( /* translators: %s: Name of current post */ esc_html__( 'Edit %s', 'cleanportfolio' ), the_title( '"', '"', false ) ), '', '' ); } endif; if ( ! function_exists( 'cleanportfolio_the_custom_logo' ) ) : /** * Displays the optional custom logo. * * Does nothing if the custom logo is not available. * * @since Clean Portfolio 0.1 */ function cleanportfolio_the_custom_logo() { if ( function_exists( 'the_custom_logo' ) ) { echo ''; } } endif; if ( ! function_exists( 'cleanportfolio_comment' ) ) : /** * Template for comments and pingbacks. * Used as a callback by wp_list_comments() for displaying the comments. */ function cleanportfolio_comment( $comment, $args, $depth ) { if ( 'pingback' == $comment->comment_type || 'trackback' == $comment->comment_type ) : ?>
  • >
    ', '' ); ?>
  • >
    is needed. WordPress will know where to add it. */ ?> %1$s', $categories_list ); } } endif;