%2$s';
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'.
return sprintf(
/* translators: %s: post date */
__( 'Posted on %s', 'amp-accelerated-mobile-pages' ),
'' . $time_string . ''
);
}
endif;
if ( ! function_exists( 'etruel_amp_logo' ) ) :
function etruel_amp_logo() {
if (etruel_amp::exist_logo()) :
?>
2));
$nav = etruel_amp_strip_tags_content($nav, '
', TRUE);
$nav = str_replace("'page-numbers'", '"button"', $nav);
$nav = str_replace('"next page-numbers"', '"next button"', $nav);
$nav = str_replace('"prev page-numbers"', '"prev button"', $nav);
echo $nav;
}
endif;
if ( ! function_exists( 'etruel_amp_theme_entry_meta' ) ) :
/**
* Prints HTML with meta information for the categories, tags.
*
* Create your own etruel_amp_theme_entry_meta() function to override in a child theme.
*
* @since 0.2.0
*/
function etruel_amp_theme_entry_meta() {
if ( 'post' === get_post_type() ) {
$author_avatar_size = apply_filters( 'etruel_amp_theme_author_avatar_size', 49 );
printf( '%1$s%2$s %4$s',
etruel_amp::get_amp_content(get_avatar( get_the_author_meta( 'user_email' ), $author_avatar_size )) ,
esc_attr_x( 'Author', 'Used before post author name.', 'amp-accelerated-mobile-pages' ),
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
get_the_author()
);
}
if ( in_array( get_post_type(), array( 'post', 'attachment' ) ) ) {
echo etruel_amp_time_link();
}
$format = get_post_format();
if ( current_theme_supports( 'post-formats', $format ) ) {
printf( '%1$s%3$s',
sprintf( '%s ', esc_attr_x( 'Format', 'Used before post format.', 'amp-accelerated-mobile-pages' ) ),
esc_url( get_post_format_link( $format ) ),
esc_attr(get_post_format_string( $format ))
);
}
if ( 'post' === get_post_type() ) {
etruel_amp_theme_entry_taxonomies();
}
if ( ! is_singular() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
echo '';
comments_popup_link(
sprintf(
/* translators: %s: post title */
__( 'Leave a comment on %s', 'amp-accelerated-mobile-pages' ), get_the_title() ) );
echo '';
}
}
endif;
if ( ! function_exists( 'etruel_amp_theme_entry_taxonomies' ) ) :
/**
* Prints HTML with category and tags for current post.
*
* Create your own etruel_amp_theme_entry_taxonomies() function to override in a child theme.
*
* @since 0.2.1
*/
function etruel_amp_theme_entry_taxonomies() {
$categories_list = get_the_category_list( esc_attr_x( ', ', 'Used between list items, there is a space after the comma.', 'amp-accelerated-mobile-pages' ) );
if ( $categories_list && etruel_amp_theme_categorized_blog() ) {
printf( '%1$s %2$s',
esc_attr_x( 'Categories', 'Used before category names.', 'amp-accelerated-mobile-pages' ),
$categories_list
);
}
$tags_list = get_the_tag_list( '', esc_attr_x( ', ', 'Used between list items, there is a space after the comma.', 'amp-accelerated-mobile-pages' ) );
if ( $tags_list ) {
printf( '%1$s %2$s',
esc_attr_x( 'Tags', 'Used before tag names.', 'amp-accelerated-mobile-pages' ),
$tags_list
);
}
}
endif;
/**
* Determine whether blog/site has more than one category.
*
* @since 0.1
*
* @return bool True of there is more than one category, false otherwise.
*/
function etruel_amp_theme_categorized_blog() {
if ( false === ( $all_the_cool_cats = get_transient( 'etruel_amp_theme_categories' ) ) ) {
// Create an array of all the categories that are attached to posts.
$all_the_cool_cats = get_categories( array(
'fields' => 'ids',
'hide_empty' => 1,
// We only need to know if there is more than one category.
'number' => 2,
) );
// Count the number of categories that are attached to the posts.
$all_the_cool_cats = count( $all_the_cool_cats );
set_transient( 'etruel_amp_theme_categories', $all_the_cool_cats );
}
if ( $all_the_cool_cats > 1 ) {
return true;
} else {
return false;
}
}
if ( ! function_exists( 'etruel_amp_post_thumbnail' ) ) :
/**
* @since 0.1.1
*/
function etruel_amp_post_thumbnail() {
if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) {
return;
}
if ( is_singular() ) :
?>