' ;
blogg_sticky_entry_post();
blogg_entry_author();
blogg_entry_date();
blogg_entry_post_format();
blogg_get_first_cat_name();
blogg_entry_comments();
blogg_edit_link();
echo '';
}
endif;
/**
* Displays the meta info for the default blog styles
*/
if ( ! function_exists( 'blogg_default_entry_meta' ) ) :
function blogg_default_entry_meta() {
echo '
' ;
blogg_sticky_entry_post();
blogg_entry_author();
blogg_entry_date();
blogg_entry_post_format();
blogg_entry_comments();
blogg_edit_link();
echo ' ';
}
endif;
// Display the post meta info for the grid blog
if ( ! function_exists( 'blogg_date_block' ) ) :
function blogg_date_block() {
$time_string = '%1$s
%2$s %3$s
';
$posted_on = sprintf( $time_string,
get_the_date( 'd' ),
get_the_date( 'M' ),
get_the_date( 'Y' )
);
echo '' . wp_kses_post($posted_on) . ' ';
}
endif;
if ( ! function_exists( 'blogg_sticky_entry_post' ) ) :
// Returns the sticky label
function blogg_sticky_entry_post() {
if( is_sticky() && ! is_archive() && esc_attr(get_theme_mod( 'blogg_show_featured_tag', true ) ) ) {
echo '', esc_html_e('Featured', 'blogg'), ' ';
}
}
endif;
if ( ! function_exists( 'blogg_entry_post_format' ) ) :
// Returns the format post label
function blogg_entry_post_format() {
$format = get_post_format();
if ( current_theme_supports( 'post-formats', $format ) ) {
$format = sprintf( '%1$s%3$s ',
sprintf( '%s ', _x( 'Format', 'Used before post format.', 'blogg' ) ),
esc_url( get_post_format_link( $format ) ),
get_post_format_string( $format )
);
}
echo $format; // WPCS: XSS OK.
}
endif;
if ( ! function_exists( 'blogg_entry_date' ) ) :
// Returns the post date
function blogg_entry_date() {
$time_string = '%2$s ';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string = '%2$s %4$s ';
}
$time_string = sprintf( $time_string,
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_attr( get_the_modified_date( 'c' ) ),
esc_html( get_the_modified_date() )
);
$posted_on = sprintf(
/* translators: %s: post date */
__( 'Posted on %s', 'blogg' ),
'' . $time_string . ' ' );
echo '' . $posted_on . ' '; // WPCS: XSS OK.
}
endif;
if ( ! function_exists( 'blogg_entry_author' ) ) :
// Returns the post author
function blogg_entry_author() {
$author_avatar_size = apply_filters( 'blogg_author_avatar_size', 48 );
$author_string = sprintf( '',
get_avatar( get_the_author_meta( 'user_email' ), $author_avatar_size ),
_x( 'Written by', 'Used before post author name.', 'blogg' ),
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
get_the_author()
);
echo '' . $author_string . ' '; // WPCS: XSS OK.
}
endif;
if ( ! function_exists( 'blogg_entry_comments' ) ) :
// Displays the post comments
function blogg_entry_comments() {
if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
echo '';
}
}
endif;
// Get the full category list for a post
if ( ! function_exists( 'blogg_categories' ) ) :
function blogg_categories() {
echo get_the_category_list(); // WPCS: XSS OK.
}
endif;
// Get just the first category name of a post
function blogg_get_first_cat_name() {
if ( 'post' === get_post_type() ) {
$cats = get_the_category();
echo '' . esc_html( $cats[0]->name ) . ' ';
}
}
// Edit link function
if ( ! function_exists( 'blogg_edit_link' ) ) :
function blogg_edit_link() {
edit_post_link(
sprintf(
wp_kses(
/* translators: %s: Name of current post. Only visible to screen readers */
__( 'Edit %s ', 'blogg' ),
array(
'span' => array(
'class' => array(),
),
)
),
get_the_title()
),
'',
' '
);
}
endif;
if ( ! function_exists( 'blogg_more_link' ) ) :
/**
* Displays the more link on excerpts
*/
function blogg_more_link() {
?>
post_excerpt;
if(!empty($get_description) ) {
// If caption exists - show it
echo '' . esc_html($get_description) . ' ';
}
}
?>
', ' ', ' ' );
if ( $tag_list && ! is_wp_error( $tag_list ) ) {
echo $tag_list; // WPCS: XSS OK.
}
}
endif;
/**
* Custom comment output
*/
function blogg_comment( $comment, $args, $depth ) { ?>
id="li-comment-
">
Theme Options > Blog Settings
*/
if ( esc_attr(get_theme_mod( 'blogg_show_archive_labels', true ) ) ) :
if ( ! function_exists( 'blogg_archive_title' ) ) :
function blogg_archive_title( $before = '', $after = '' ) {
if ( is_category() ) {
$title = single_cat_title( '', false );
} elseif ( is_tag() ) {
$title = sprintf(
/* translators: %s: Name of tag */
esc_html__( 'Articles with %s', 'blogg' ), single_tag_title( '', false ) );
} elseif ( is_author() ) {
$title = sprintf(
/* translators: %s: Name of author */
esc_html__( 'Articles by %s', 'blogg' ), '' . get_the_author() . ' ' );
} elseif ( is_year() ) {
$title = sprintf(
/* translators: %s: Name of year */
esc_html__( 'Articles from: %s', 'blogg' ), get_the_date( esc_html_x( 'Y', 'yearly archives date format', 'blogg' ) ) );
} elseif ( is_month() ) {
$title = sprintf(
/* translators: %s: Name of month */
esc_html__( 'Articles from %s', 'blogg' ), get_the_date( esc_html_x( 'F Y', 'monthly archives date format', 'blogg' ) ) );
} elseif ( is_day() ) {
$title = sprintf(
/* translators: %s: Name of day */
esc_html__( 'Articles from %s', 'blogg' ), get_the_date( esc_html_x( 'F j, Y', 'daily archives date format', 'blogg' ) ) );
} elseif ( is_post_type_archive() ) {
$title = sprintf(
/* translators: %s: Name of archive title */
esc_html__( 'Archives: %s', 'blogg' ), post_type_archive_title( '', false ) );
} elseif ( is_tax() ) {
$tax = get_taxonomy( get_queried_object()->taxonomy );
/* translators: 1: Taxonomy singular name, 2: Current taxonomy term */
$title = sprintf(
/* translators: %s: Name of title */
esc_html__( '%1$s: %2$s', 'blogg' ), $tax->labels->singular_name, single_term_title( '', false ) );
} else {
$title = esc_html__( 'Archives', 'blogg' );
}
/**
* Filter the archive title.
* @param string $title Archive title to be displayed.
*/
$title = apply_filters( 'get_the_archive_title', $title );
if ( ! empty( $title ) ) {
echo $before . $title . $after; // WPCS: XSS OK.
}
}
endif;
endif;
/**
* Displays pagination on the blog and archive pages
*/
if ( ! function_exists( 'blogg_blog_navigation' ) ) :
function blogg_blog_navigation() {
the_posts_pagination( array(
'mid_size' => 2,
'prev_text' => '« ' . esc_html_x( 'Previous Posts', 'pagination', 'blogg' ) . ' ',
'next_text' => '' . esc_html_x( 'Next Posts', 'pagination', 'blogg' ) . ' » ',
) );
}
endif;
/**
* Displays Single Post Navigation
*/
if ( ! function_exists( 'blogg_post_navigation' ) ) :
function blogg_post_navigation() {
if( esc_attr(get_theme_mod( 'blogg_crop_list_featured', true ) || is_customize_preview()) ) {
the_post_navigation( array(
'prev_text' => '' . esc_html_x( 'Previous Post', 'post navigation', 'blogg' ) . ' %title ',
'next_text' => '' . esc_html_x( 'Next Post', 'post navigation', 'blogg' ) . ' %title ',
) );
}
}
endif;
/**
* Displays Multi-page Navigation
*/
if ( ! function_exists( 'blogg_multipage_navigation' ) ) :
function blogg_multipage_navigation() {
wp_link_pages( array(
'before' => '' . esc_html__( 'Pages:', 'blogg' ),
'after' => '
',
'link_before' => '',
'link_after' => ' ',
) );
}
endif;
$depth, 'max_depth' => $args['max_depth'] ) ) ) ?>