%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() ) ); if ( 'testimonial' == $type ) { echo '' . $time_string . ''; // WPCS: XSS OK. } else { echo '' . $time_string . ''; // WPCS: XSS OK. } } endif; // ends check for canape_posted_on() if ( ! function_exists( 'canape_entry_meta' ) ) : /** * Prints HTML with meta information for current post: date, comments and edit link. */ function canape_entry_meta() { // Sticky if ( is_sticky() && is_home() && ! is_paged() ) { echo '' . esc_html__( 'Featured', 'canape' ) . ''; } // Date if ( ! is_sticky() ) { canape_posted_on(); } // Comments if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { echo ''; comments_popup_link( esc_html__( 'Leave a comment', 'canape' ), esc_html__( '1 Comment', 'canape' ), esc_html__( '% Comments', 'canape' ) ); echo ''; } // Edit link edit_post_link( esc_html__( 'Edit', 'canape' ), '', '' ); } endif; // ends check for canape_entry_meta() if ( ! function_exists( 'canape_entry_footer' ) ) : /** * Prints HTML with meta information for the categories and tags. */ function canape_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__( ', ', 'canape' ) ); if ( $categories_list && canape_categorized_blog() ) { printf( '' . esc_html__( 'Posted in %1$s', 'canape' ) . '', $categories_list ); // WPCS: XSS OK. } /* translators: used between list items, there is a space after the comma */ the_tags( sprintf( '%s ', esc_html__( 'Tagged', 'canape' ) ), esc_html__( ', ', 'canape' ), '' ); } } endif; // ends check for canape_entry_footer() /** * Display an optional post thumbnail. * * Wraps the post thumbnail in an anchor element on index * views, or a div element when on single views. */ function canape_post_thumbnail() { if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { return; } if ( is_singular() ) : ?>
comment_type || 'trackback' == $comment->comment_type ) : ?>
  • >
    ', '' ); ?>
  • >
    %s', get_comment_author_link() ); ?> comment_approved ) : ?>

    ', '' ); ?> 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'], 'before' => '', 'after' => '', ) ) ); ?>
    '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 = is_countable( $all_the_cool_cats ) ? count( $all_the_cool_cats ) : 0; set_transient( 'canape_categories', $all_the_cool_cats ); } if ( $all_the_cool_cats > 1 ) { // This blog has more than 1 category so canape_categorized_blog should return true. return true; } else { // This blog has only 1 category so canape_categorized_blog should return false. return false; } } /** * Flush out the transients used in canape_categorized_blog. */ function canape_category_transient_flusher() { if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { return; } // Like, beat it. Dig? delete_transient( 'canape_categories' ); } add_action( 'edit_category', 'canape_category_transient_flusher' ); add_action( 'save_post', 'canape_category_transient_flusher' );