', $logo, esc_html($site_title));
$classname = $args['logo_class'];
} else {
$contents = sprintf($args['title'], esc_url( get_home_url(null, '/') ), esc_html($site_title));
$classname = $args['title_class'];
}
$wrap = 'home_wrap';
$html = sprintf($args[$wrap], $classname, $contents);
/**
* Filters the arguments for `blogcraft_site_logo()`.
*
* @param string $html Compiled html based on our arguments.
* @param array $args Parsed arguments.
* @param string $classname Class name based on current view, home or single.
* @param string $contents HTML for site title or logo.
*/
$html = apply_filters('blogcraft_site_logo', $html, $args, $classname, $contents);
if (!$echo) {
return $html;
}
echo $html; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
endif;
if( !function_exists('blogcraft_site_description') ):
/**
* Displays the site description.
*
* @param boolean $echo Echo or return the html.
*
* @return string $html The HTML to display.
*/
function blogcraft_site_description($echo = true){
$description = get_bloginfo('description');
if (!$description) {
return;
}
$wrapper = '
%s
';
$html = sprintf($wrapper, esc_html($description));
/**
* Filters the html for the site description.
*
* @param string $html The HTML to display.
* @param string $description Site description via `bloginfo()`.
* @param string $wrapper The format used in case you want to reuse it in a `sprintf()`.
* @since 1.0.0
*
*/
$html = apply_filters('blogcraft_site_description', $html, $description, $wrapper);
if (!$echo) {
return $html;
}
echo $html; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
endif;
if( !function_exists('blogcraft_posted_on') ):
/**
* Prints HTML with meta information for the current post-date/time.
*/
function blogcraft_posted_on(){
$blogcraft_default = blogcraft_get_default_theme_options();
$ed_post_date = absint( get_theme_mod( 'ed_post_date',$blogcraft_default['ed_post_date'] ) );
if( $ed_post_date ){
$time_string = '';
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())
);
$year = get_the_date('Y');
$month = get_the_date('m');
$day = get_the_date('d');
$link = get_day_link($year, $month, $day);
$posted_on = ''. esc_html__('Posted On ','blogcraft') . $time_string . '';
echo '
';
}
}
endif;
if( !function_exists('blogcraft_posted_by') ) :
/**
* Prints HTML with meta information for the current author.
*/
function blogcraft_posted_by(){
$blogcraft_default = blogcraft_get_default_theme_options();
$ed_post_author = absint( get_theme_mod( 'ed_post_author',$blogcraft_default['ed_post_author'] ) );
if( $ed_post_author ){
$byline = '' . esc_html__('Posted By ','blogcraft') . esc_html(get_the_author()) . '';
echo '
' . $byline . '
';
}
}
endif;
if( !function_exists('blogcraft_entry_footer') ):
/**
* Prints HTML with meta information for the categories, tags and comments.
*/
function blogcraft_entry_footer( $cats = true, $tags = true, $edits = true ){
$blogcraft_default = blogcraft_get_default_theme_options();
$ed_post_category = absint( get_theme_mod( 'ed_post_category',$blogcraft_default['ed_post_category'] ) );
$ed_post_tags = absint( get_theme_mod( 'ed_post_tags',$blogcraft_default['ed_post_tags'] ) );
// Hide category and tag text for pages.
if( 'post' === get_post_type() ){
if( $cats && $ed_post_category ){
/* translators: used between list items, there is a space after the comma */
$categories = get_the_category();
echo '
';
echo '
';
/* translators: 1: list of categories. */
echo '';
foreach( $categories as $category ){
$cat_name = $category->name;
$cat_slug = $category->slug;
$cat_url = get_category_link( $category->term_id ); ?>
';
echo '
';
echo '
';
}
if( $tags && $ed_post_tags ){
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list('', esc_html_x(', ', 'list item separator', 'blogcraft'));
if( $tags_list ){
echo '