term_id ) ) . '" title="' . esc_attr( sprintf( __( "View all posts in %s", 'begonia-lite' ), esc_html( $category->name ) ) ) . '">' . esc_html( $category->cat_name ) . '' . $separator; } echo trim( $output, $separator ); } ?>
'; ?> %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 . '' ; echo '' . $posted_on . ''; } endif; if ( ! function_exists( 'begonia_lite_entry_footer' ) ) : /** * Prints HTML with meta information for the categories, tags and comments. */ function begonia_lite_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( '', ' ' ); if ( $tags_list ) { // translators: the %1$s is replaced with the tags list printf( '' . esc_html__( 'Tags: %1$s', 'begonia-lite' ) . '', $tags_list ); // WPCS: XSS OK. } } if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { echo ''; /* translators: %s: post title */ comments_popup_link( sprintf( wp_kses( __( 'Leave a Comment on %s', 'begonia-lite' ), array( 'span' => array( 'class' => array() ) ) ), get_the_title() ) ); echo ''; } edit_post_link( sprintf( /* translators: %s: Name of current post */ esc_html__( 'Edit %s', 'begonia-lite' ), the_title( '"', '"', false ) ), '', '' ); } endif; if ( ! function_exists( 'begonia_lite_single_post_navigation' ) ) : function begonia_lite_single_post_navigation() { echo ''; } endif; if ( ! function_exists( 'begonia_get_post_thumbnail_aspect_ratio_class' ) ) : /** * Get the aspect ratio of the featured image * * @param int|WP_Post $post_id Optional. Post ID or post object. * @return string Aspect ratio specific class. */ function begonia_get_post_thumbnail_aspect_ratio_class( $post_id = null ) { $post = get_post( $post_id ); $class = ''; if ( empty( $post ) ) { return $class; } // [tall|portrait|square|landscape|wide] class depending on the aspect ratio // 16:9 = 1.78 // 3:2 = 1.500 // 4:3 = 1.34 // 1:1 = 1.000 // 3:4 = 0.750 // 2:3 = 0.67 // 9:16 = 0.5625 //$image_data["width"] is width //$image_data["height"] is height //get directly the raw metadata $image_data = wp_get_attachment_metadata( get_post_thumbnail_id( $post->ID ) ); if ( ! empty( $image_data["width"] ) && ! empty( $image_data["height"] ) ) { $image_aspect_ratio = $image_data["width"] / $image_data["height"]; //now let's begin to see what kind of featured image we have //first TALL ones; lower than 9:16 if ( $image_aspect_ratio < 0.5625 ) { $class = 'tall'; } elseif ( $image_aspect_ratio < 0.75 ) { //now PORTRAIT ones; lower than 3:4 $class = 'portrait'; } elseif ( $image_aspect_ratio > 1.78 ) { //now WIDE ones; higher than 16:9 $class = 'wide'; } elseif ( $image_aspect_ratio > 1.34 ) { //now LANDSCAPE ones; higher than 4:3 $class = 'landscape'; } else { //it's definitely a SQUARE-ish one; between 3:4 and 4:3 $class = 'square'; } } return $class; } #function endif;