%2$s';
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() ),
esc_attr( get_the_modified_date( DATE_W3C ) ),
esc_html( get_the_modified_date() )
);
return sprintf( '%2$s',
esc_url( get_permalink() ),
$time_string
);
}
endif;
if ( ! function_exists( 'apace_posted_by' ) ) :
/**
* Prints HTML with meta information for the current author.
*/
function apace_posted_by() {
return sprintf( '%2$s',
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_html( get_the_author() )
);
}
endif;
if ( ! function_exists( 'apace_category_list' ) ) :
/**
* Displays the category list.
*/
function apace_category_list() {
$categories_list = get_the_category_list( ' ' );
if ( $categories_list ) {
printf( '
%1$s
', $categories_list ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
}
endif;
if ( ! function_exists( 'apace_tag_list' ) ) :
/**
* Displays the category list.
*/
function apace_tag_list() {
$tag_list = get_the_tag_list( ' ' );
if ( $tag_list ) {
printf( '%1$s%2$s
', apace_get_icon_svg( 'tag' ), $tag_list ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
}
endif;
if ( ! function_exists( 'apace_comments_link' ) ) :
/**
* Displays the comments link.
*/
function apace_comments_link() {
if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
$num_comments = get_comments_number();
$svg_icon = apace_get_icon_svg( 'comments' );
return sprintf( '',
$svg_icon,
esc_url( get_comments_link() ),
esc_html( $num_comments )
);
}
}
endif;
if ( ! function_exists( 'apace_entry_meta' ) ) :
/**
* Displays entry meta.
*/
function apace_entry_meta() {
$meta_data = array();
if ( is_single() ) {
if ( true == get_theme_mod( 'apace_show_post_author', true ) ) {
$meta_data[] = apace_posted_by();
}
if ( true == get_theme_mod( 'apace_show_post_date', true ) ) {
$meta_data[] = apace_posted_on();
}
if ( true == get_theme_mod( 'apace_show_post_comment_link', true ) ) {
if ( ! empty( apace_comments_link() ) ) {
$meta_data[] = apace_comments_link();
}
}
} else {
if ( true == get_theme_mod( 'apace_show_arc_author', true ) ) {
$meta_data[] = apace_posted_by();
}
if ( true == get_theme_mod( 'apace_show_arc_date', true ) ) {
$meta_data[] = apace_posted_on();
}
if ( true == get_theme_mod( 'apace_show_arc_comment_link', true ) ) {
if ( ! empty( apace_comments_link() ) ) {
$meta_data[] = apace_comments_link();
}
}
}
if ( ! empty( $meta_data ) ) {
$svg_icon = apace_get_icon_svg( 'dash' );
$separator = ''. $svg_icon .'';
$meta_string = implode( $separator, $meta_data );
echo $meta_string; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
}
endif;
if ( ! function_exists( 'apace_post_thumbnail' ) ) :
/**
* Displays an optional post thumbnail.
*
* Wraps the post thumbnail in an anchor element on index views, or a div
* element when on single views.
*/
function apace_post_thumbnail() {
if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) {
return;
}
if ( is_singular() ) : ?>
';
}
if ( 'chevron-right' == $icon_name ) {
$output = '';
}
if ( 'arrow-right' == $icon_name ) {
$output = '';
}
if ( 'arrow-left' == $icon_name ) {
$output = '';
}
if ( 'menu-bars' == $icon_name ) {
$output = '';
}
if ( 'close' == $icon_name ) {
$output = '';
}
if ( 'tag' == $icon_name ) {
$output = '';
}
if ( 'comments' == $icon_name ) {
$output = '';
}
if ( 'dash' == $icon_name ) {
$output = '';
}
return $output;
}
endif;
/**
* Echo svg icon.
*/
function apace_the_icon_svg( $icon ) {
echo apace_get_icon_svg( $icon ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in function.
}
if ( ! function_exists( 'apace_posts_pagination' ) ) :
/**
* Posts pagination
*/
function apace_posts_pagination() {
the_posts_pagination(
array(
'class' => 'apace-pagination',
'mid_size' => 2,
'prev_text' => sprintf(
/* translators: left arrow */
esc_html__( '%s Previous', 'apace' ),
'←'
),
'next_text' => sprintf(
/* translators: right arrow */
esc_html__( 'Next %s', 'apace' ),
'→'
),
)
);
}
endif;