' . get_avatar( get_the_author_meta( 'ID' ), 30 ) . '' . esc_html( get_the_author() ) . ''
);
echo ' ' . $byline . ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
endif;
if ( ! function_exists( 'businessroy_themes_posted_on' ) ) :
/**
* Display the post date with short month format.
*
* Prints HTML with meta information for the current post-date/time.
*
* @return void
*/
function businessroy_themes_posted_on() {
// Define short month date format.
$short_date_format = 'M j, Y';
$time_string = '';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string = '';
}
$time_string = sprintf(
$time_string,
esc_attr( get_the_date( DATE_W3C ) ),
esc_html( get_the_date( $short_date_format ) ),
esc_attr( get_the_modified_date( DATE_W3C ) ),
esc_html( get_the_modified_date( $short_date_format ) )
);
$posted_on = sprintf(
/* translators: %s: post date */
esc_html_x( 'On %s', 'post date', 'business-roy' ),
'' . $time_string . ''
);
echo ' - ' . wp_kses_post( $posted_on ) . '';
}
endif;
if ( ! function_exists( 'businessroy_themes_comments' ) ) :
function businessroy_themes_comments() {
echo '
';
}
endif;
if ( ! function_exists( 'businessroy_themes_estimated_reading_time' ) ) :
/**
* Calculates and returns estimated reading time.
*
* @return string HTML output for reading time.
*/
function businessroy_themes_estimated_reading_time() {
global $post;
$the_content = $post->post_content;
$words = str_word_count( wp_strip_all_tags( $the_content ) );
$minute = floor( $words / 200 );
$second = floor( $words % 200 / ( 200 / 60 ) );
// Avoid division by zero.
if ( 0 === $minute && 0 === $second ) {
$minute = 1;
}
$minute_text = ( 1 === $minute ) ? 'min' : 'mins';
$second_text = ( 1 === $second ) ? 'sec' : 'secs';
$estimate = $minute . ' ' . $minute_text . ', ' . $second . ' ' . $second_text;
$output = '- ' . esc_html( $estimate ) . '';
return $output;
}
endif;
if ( ! function_exists( 'businessroy_themes_category' ) ) :
function businessroy_themes_category() {
$categories_list = get_the_category_list( esc_html__( ', ', 'business-roy' ) );
if ( $categories_list ) {
printf( '' . '%1$s' . '', $categories_list );
}
}
endif;
if ( ! function_exists( 'businessroy_themes_entry_footer' ) ) :
function businessroy_themes_entry_footer() {
if ( 'post' === get_post_type() ) {
$categories_list = get_the_category_list( esc_html__( ', ', 'business-roy' ) );
if ( $categories_list ) {
printf( '' . esc_html__( 'Posted in %1$s', 'business-roy' ) . '', $categories_list );
}
$tags_list = get_the_tag_list( '', esc_html_x( ', ', 'list item separator', 'business-roy' ) );
if ( $tags_list ) {
printf( '' . esc_html__( 'Tagged %1$s', 'business-roy' ) . '', $tags_list );
}
}
if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
echo '';
}
edit_post_link(
sprintf(
wp_kses(
__( 'Edit %s', 'business-roy' ),
array(
'span' => array(
'class' => array(),
),
)
),
get_the_title()
),
'',
''
);
}
endif;
function businessroy_themes_excerpt_length( $length ) {
$excerpt_length = get_theme_mod( 'businessroy_post_excerpt_length', 20 );
if( is_admin() ){
return $length;
}elseif( is_front_page() ){
return 20;
}else{
return $excerpt_length;
}
}
add_filter( 'excerpt_length', 'businessroy_themes_excerpt_length', 999 );
function businessroy_themes_excerpt_more($text){
if(is_admin()){
return $text;
}
return '…';
}
add_filter( 'excerpt_more', 'businessroy_themes_excerpt_more' );