' . $author_avatar . get_the_author() . ''
);
echo '' . $byline . '';
}
endif;
if ( ! function_exists( 'artpop_time_link' ) ) :
/**
* Prints HTML with meta information for the published date.
*/
function artpop_time_link() {
$time_string = '';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string = '';
}
$time_string = sprintf( $time_string,
get_the_date( DATE_W3C ),
get_the_date(),
get_the_modified_date( DATE_W3C ),
get_the_modified_date()
);
// Wrap the time string in a link, and preface it with 'Posted on'.
printf( '%1$s%3$s',
_x( 'Posted on', 'Used before publish date.', 'artpop' ),
esc_url( get_permalink() ),
$time_string
);
}
endif;
if ( ! function_exists( 'artpop_category_link' ) ) :
/**
* Prints HTML with meta information for categories.
*/
function artpop_category_link() {
if ( 'post' === get_post_type() ) {
// Get Categories for posts.
$categories_list = get_the_category_list( esc_html__( ', ', 'artpop' ) );
echo '';
echo '' . __( 'in', 'artpop' ) . '';
echo $categories_list;
echo '';
}
}
endif;
if ( ! function_exists( 'artpop_comments_link' ) ) :
/**
* Prints HTML with meta information for comments.
*/
function artpop_comments_link() {
if ( is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
echo '';
comments_popup_link(
__( 'Leave a comment', 'artpop' ),
__( '1 Comment', 'artpop' ),
__( '% Comments', 'artpop' )
);
echo '';
}
}
endif;
if ( ! function_exists( 'artpop_entry_footer' ) ) :
/**
* Prints HTML with meta information for the tags.
*/
function artpop_entry_footer() {
// Hide category and tag text for pages.
if ( 'post' === get_post_type() ) {
// Get Tags for posts.
$tags_list = get_the_tag_list( '', ( ' ' ) );
if ( $tags_list ) {
printf( '%1$s',
$tags_list
);
}
}
// Show edit link for logged in user
edit_post_link(
sprintf(
/* translators: %s: Name of current post */
esc_html__( 'Edit %s', 'artpop' ),
the_title( '"', '"', false )
),
'',
''
);
}
endif;
/**
* Filters the archive title.
*/
function artpop_get_the_archive_title( $title ) {
$regex = apply_filters(
'artpop_get_the_archive_title_regex',
array(
'pattern' => '/(\A[^\:]+\:)/',
'replacement' => '$1',
)
);
if ( empty( $regex ) ) {
return $title;
}
return preg_replace( $regex['pattern'], $regex['replacement'], $title );
}
add_filter( 'get_the_archive_title', 'artpop_get_the_archive_title' );
/**
* Get unique ID.
*
* This is a PHP implementation of Underscore's uniqueId method. A static variable
* contains an integer that is incremented with each call. This number is returned
* with the optional prefix. As such the returned value is not universally unique,
* but it is unique across the life of the PHP process.
*
* @see wp_unique_id() Themes requiring WordPress 5.0.3 and greater should use this instead.
*
* @staticvar int $id_counter
*
* @param string $prefix Prefix for the returned ID.
* @return string Unique ID.
*/
function artpop_unique_id( $prefix = '' ) {
static $id_counter = 0;
if ( function_exists( 'wp_unique_id' ) ) {
return wp_unique_id( $prefix );
}
return $prefix . (string) ++$id_counter;
}