',
$heading, esc_url( get_permalink() )
),
sprintf( '%s>', $heading ),
false );
} else {
/**
* Build the title markup without a link.
*/
$title_markup = the_title(
sprintf(
'<%1$s class="entry-title">',
$heading, esc_url( get_permalink() )
),
sprintf( '%s>', $heading ),
false );
}
echo $title_markup;
}
} // End if().
if ( ! function_exists( 'fanoe_get_the_date' ) ) {
/**
* Returns get_the_date() with or without a link to the single view.
*
* @param bool $link If the date should link to the single view.
*
* @return string Date markup.
*/
function fanoe_get_the_date( $link = true ) {
if ( $link ) {
$date_markup = sprintf(
'%s',
get_the_permalink(),
get_the_date()
);
} else {
$date_markup = get_the_date();
}
return $date_markup;
}
} // End if().
if ( ! function_exists( 'fanoe_the_entry_header_meta' ) ) {
/**
* Displays meta data for entry header.
*/
function fanoe_the_entry_header_meta() {
/**
* Get the date, linked to the post.
*/
$meta_markup = sprintf(
'%s',
fanoe_get_the_date()
);
/**
* Get reactions separated by type.
*/
$comments_by_type = fanoe_get_comments_by_type();
/**
* Get the comment count text.
*/
$comment_count_text = fanoe_get_comments_number_text( $comments_by_type );
/**
* Check if we do not have an empty string from the funtion call.
*/
if ( '' !== $comment_count_text ) {
$meta_markup .= sprintf(
' %s',
$comment_count_text
);
} // End if().
/**
* Get the pings count text.
*/
$ping_count_text = fanoe_get_pings_number_text( $comments_by_type );
/**
* Check if it is not empty.
*/
if ( '' !== $ping_count_text ) {
$meta_markup .= sprintf(
' %s',
$ping_count_text
);
} // End if().
/**
* Display the string.
*/
printf(
'
%s
',
$meta_markup
);
}
} // End if().
if ( ! function_exists( 'fanoe_get_comments_by_type' ) ) {
/**
* Returns the post reactions by type (comments and pingbacks).
*
* @return array Post reactions separated by type.
*/
function fanoe_get_comments_by_type() {
$comment_args = [
'order' => 'ASC',
'orderby' => 'comment_date_gmt',
'status' => 'approve',
'post_id' => get_the_ID(),
];
$comments = get_comments( $comment_args );
$comments_by_type = separate_comments( $comments );
return $comments_by_type;
}
}
if ( ! function_exists( 'fanoe_the_post_thumbnail' ) ) {
/**
* Displays the post thumbnail with caption.
*/
function fanoe_the_post_thumbnail() {
/**
* Check if we have a post thumbnail.
*/
if ( has_post_thumbnail() ) {
printf(
'',
get_permalink(),
get_the_post_thumbnail( null, 'large' ),
fanoe_get_post_thumbnail_caption()
);
} // End if().
}
} // End if().
if ( ! function_exists( 'fanoe_the_content' ) ) {
/**
* Displays the_content() with a more accessible more tag.
*/
function fanoe_the_content() {
/* translators: visible text for the more tag */
the_content(
sprintf(
'%1s%2s',
__( 'Continue reading', 'fanoe' ),
sprintf( /* translators: continue reading text for screen reader users. s=post title */
__( 'Continue reading %s', 'fanoe' ),
the_title( '', '', false )
)
)
);
}
} // End if().
if ( ! function_exists( 'fanoe_the_footer_meta' ) ) {
/**
* Displays entry footer meta string.
*/
function fanoe_the_footer_meta() {
/**
* Get categories list.
*/
$meta_string = sprintf( /* translators: 1=categories list; 2=author */
__( 'Posted in %1$s by %2$s', 'fanoe' ),
get_the_category_list( ', ' ),
get_the_author()
);
/**
* Get the tags list.
*/
$tag_list = fanoe_get_tag_list();
/**
* Check if we have tags.
*/
if ( '' !== $tag_list ) {
/**
* Add tag list to meta string.
*/
$meta_string .= " · $tag_list";
} // End if().
/**
* Get the edit post link.
*/
$edit_post_link = get_edit_post_link();
/**
* Check if we have an edit link.
*/
if ( null !== $edit_post_link ) {
/**
* Add the link to the meta string.
*/
$meta_string .= sprintf(
' · %s',
sprintf(
'%s',
$edit_post_link,
__( 'Edit', 'fanoe' ) )
);
} // End if().
echo "
$meta_string
";
}
} // End if().
if ( ! function_exists( 'fanoe_comment' ) ) {
/**
* Displays comments.
*
* Used as a callback by wp_list_comments() for displaying the comments.
*/
function fanoe_comment( $comment, $args, $depth ) { ?>
__( 'Reply', 'fanoe' ), 'depth' => $depth, 'max_depth' => $args['max_depth'], ] ) ); ?>