%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 = ''. esc_html__( 'Posted on', 'kids-education' ) .' ' . $time_string . ''; echo '' . $posted_on . ''; // WPCS: XSS OK. if( function_exists( 'tp_education_like_button' ) ){ $like_string = tp_education_like_button(); $like_string = '' . esc_html__( 'Likes', 'kids-education' ) . '' . $like_string; echo wp_kses_post( $like_string ); } $no_of_comment = get_comments_number(); // get no of comments in a post $comment_number = sprintf( ''. esc_html__( 'Comments', 'kids-education' ) .' %s', absint( $no_of_comment ) ); echo ''. $comment_number .''; } endif; if ( ! function_exists( 'kids_education_entry_footer' ) ) : /** * Prints HTML page edit link. */ function kids_education_entry_footer() { edit_post_link( sprintf( /* translators: %s: Name of current post */ esc_html__( 'Edit %s', 'kids-education' ), the_title( '"', '"', false ) ), '', '' ); } endif; if ( ! function_exists( 'kids_education_tags_list' ) ) : /** * Prints tags assisgned to a post. */ function kids_education_tags_list() { $tags_list = get_the_tag_list( '', esc_html__( ', ', 'kids-education' ) ); //get tags lists if( !empty( $tags_list ) ){ echo '
'. esc_html__( 'Tagged', 'kids-education') .' '; printf( ' ' . esc_html__( 'Tags: %1$s', 'kids-education' ) . '', $tags_list ); echo '
'; } } endif; /** * Returns true if a blog has more than 1 category. * * @return bool */ function kids_education_categorized_blog() { if ( false === ( $all_the_cool_cats = get_transient( 'kids_education_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( 'kids_education_categories', $all_the_cool_cats ); } if ( $all_the_cool_cats > 1 ) { // This blog has more than 1 category so kids_education_categorized_blog should return true. return true; } else { // This blog has only 1 category so kids_education_categorized_blog should return false. return false; } } /** * Flush out the transients used in kids_education_categorized_blog. */ function kids_education_category_transient_flusher() { if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { return; } // Like, beat it. Dig? delete_transient( 'kids_education_categories' ); } add_action( 'edit_category', 'kids_education_category_transient_flusher' ); add_action( 'save_post', 'kids_education_category_transient_flusher' );