%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( DATE_W3C ) ),
esc_html( get_the_date() ),
esc_attr( get_the_modified_date( DATE_W3C ) ),
esc_html( get_the_modified_date() )
);
$posted_on = '' . $time_string . ' ';
echo '' . $posted_on . ' '; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
endif;
if ( ! function_exists( 'botiga_posted_by' ) ) :
/**
* Prints HTML with meta information for the current author.
*/
function botiga_posted_by() {
global $post;
$author = $post->post_author;
$show_avatar = get_theme_mod( 'show_avatar', 0 );
$byline = '';
if ( $show_avatar ) {
$byline .= get_avatar( get_the_author_meta( 'email', $author ) , 16 );
}
$byline .= '' . esc_html( get_the_author() ) . ' ';
echo ' ' . $byline . ' '; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
endif;
if ( ! function_exists( 'botiga_post_categories' ) ) :
function botiga_post_categories() {
if ( 'post' === get_post_type() ) {
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list( esc_html__( ', ', 'botiga' ) );
if ( $categories_list ) {
/* translators: 1: list of categories. */
printf( '' . '%1$s' . ' ', $categories_list ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
}
}
endif;
if ( ! function_exists( 'botiga_entry_comments' ) ) :
function botiga_entry_comments() {
if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
echo '';
}
}
endif;
if ( ! function_exists( 'botiga_post_reading_time' ) ) :
function botiga_post_reading_time() {
global $post;
$words_per_min = apply_filters( 'botiga_post_reading_time_words_per_minute', 300 );
$words = str_word_count(strip_tags($post->post_content));
$m = $words / $words_per_min;
/* translators: 1: time, 2: plural for min(s). */
$time = sprintf( __( '%1$s min%2$s read', 'botiga' ), ( $m < 1 ? '1' : ceil($m) ), ( $m == 1 || $m < 1 ? '' : 's' ) );
echo '';
echo esc_html( $time );
echo ' ';
}
endif;
if ( ! function_exists( 'botiga_entry_footer' ) ) :
/**
* Prints HTML with meta information for the categories, tags and comments.
*/
function botiga_entry_footer() {
$single_post_show_tags = get_theme_mod( 'single_post_show_tags', 1 );
if ( !$single_post_show_tags ) {
return;
}
// Hide category and tag text for pages.
if ( 'post' === get_post_type() ) {
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list( '' );
if ( $tags_list ) {
/* translators: 1: list of tags. */
printf( '' . esc_html__( 'Tagged %1$s', 'botiga' ) . ' ', $tags_list ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
}
edit_post_link(
sprintf(
wp_kses(
/* translators: %s: Name of current post. Only visible to screen readers */
__( 'Edit %s ', 'botiga' ),
array(
'span' => array(
'class' => array(),
),
)
),
wp_kses_post( get_the_title() )
),
'',
' '
);
}
endif;
if ( ! function_exists( 'botiga_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 botiga_post_thumbnail() {
if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) {
return;
}
if ( is_singular() ) :
$blog_single_layout = get_theme_mod( 'blog_single_layout', 'layout1' );
switch ( $blog_single_layout ) {
case 'layout1':
$thumbnail_size = 'botiga-large';
break;
case 'layout2':
$thumbnail_size = 'botiga-extra-large';
break;
case 'layout3':
$thumbnail_size = 'full';
break;
} ?>
the_title_attribute(
array(
'echo' => false,
)
),
)
);
?>
';
foreach( $elements as $element ) {
call_user_func( $element );
}
echo '';
}
endif;
if ( ! function_exists( 'botiga_single_post_share_box' ) ) :
/**
* Single post share box
*/
function botiga_single_post_share_box() {
$enable = get_theme_mod( 'single_post_share_box', 0 );
if ( !$enable ) {
return;
}
global $post;
$post_url = urlencode( esc_url( get_permalink($post->ID) ) );
$post_title = urlencode( $post->post_title );
$sharing_title = get_theme_mod( 'single_post_share_box_title', esc_html__( 'SHARE:', 'botiga' ) );
$enabled_networks = get_theme_mod( 'single_post_share_box_networks', array( 'facebook', 'twitter', 'linkedin' ) );
$networks = array(
'facebook' => array(
'url' => str_replace( '{title}', $post_title, str_replace( '{url}', $post_url, 'https://www.facebook.com/sharer.php?u={url}' ) ),
'tooltip' => esc_html__( 'Facebook', 'botiga' )
),
'twitter' => array(
'url' => str_replace( '{title}', $post_title, str_replace( '{url}', $post_url, 'https://twitter.com/intent/tweet?url={url}&text={title}' ) ),
'tooltip' => esc_html__( 'Twitter', 'botiga' )
),
'linkedin' => array(
'url' => str_replace( '{title}', $post_title, str_replace( '{url}', $post_url, 'https://www.linkedin.com/sharing/share-offsite/?url={url}' ) ),
'tooltip' => esc_html__( 'Linkedin', 'botiga' )
),
'reddit' => array(
'url' => str_replace( '{title}', $post_title, str_replace( '{url}', $post_url, 'https://reddit.com/submit?url={url}&title={title}' ) ),
'tooltip' => esc_html__( 'Reddit', 'botiga' )
),
'whatsapp' => array(
'url' => str_replace( '{title}', $post_title, str_replace( '{url}', $post_url, 'whatsapp://send/?text={url}' ) ),
'tooltip' => esc_html__( 'WhatsApp', 'botiga' )
),
'pinterest' => array(
'url' => str_replace( '{title}', $post_title, str_replace( '{url}', $post_url, 'http://pinterest.com/pin/create/link/?url={url}' ) ),
'tooltip' => esc_html__( 'Pinterest', 'botiga' )
),
'telegram' => array(
'url' => str_replace( '{title}', $post_title, str_replace( '{url}', $post_url, 'https://t.me/share/url?url={url}&text={title}' ) ),
'tooltip' => esc_html__( 'Telegram', 'botiga' )
),
'weibo' => array(
'url' => str_replace( '{title}', $post_title, str_replace( '{url}', $post_url, 'http://service.weibo.com/share/share.php?url={url}&appkey=&title={title}&pic=&ralateUid=' ) ),
'tooltip' => esc_html__( 'Weibo', 'botiga' )
),
'vk' => array(
'url' => str_replace( '{title}', $post_title, str_replace( '{url}', $post_url, 'http://vk.com/share.php?url={url}&title={title}&comment={text}' ) ),
'tooltip' => esc_html__( 'VK', 'botiga' )
),
'ok' => array(
'url' => str_replace( '{title}', $post_title, str_replace( '{url}', $post_url, 'https://connect.ok.ru/dk?st.cmd=WidgetSharePreview&st.shareUrl={url}' ) ),
'tooltip' => esc_html__( 'OK', 'botiga' )
),
'xing' => array(
'url' => str_replace( '{title}', $post_title, str_replace( '{url}', $post_url, 'https://www.xing.com/spi/shares/new?url={url}' ) ),
'tooltip' => esc_html__( 'Xing', 'botiga' )
),
'mail' => array(
'url' => str_replace( '{title}', $post_title, str_replace( '{url}', $post_url, 'mailto:?subject=' . $post->post_title . '&body={url}' ) ),
'tooltip' => esc_html__( 'Mail', 'botiga' )
),
'copyclipboard' => array(
'url' => $post_url,
'tooltip' => esc_html__( 'Copy Link', 'botiga' )
),
); ?>
'' . esc_html__( 'Previous:', 'botiga' ) . ' %title ',
'next_text' => '' . esc_html__( 'Next:', 'botiga' ) . ' %title ',
)
);
}
add_action( 'botiga_after_single_post_content', 'botiga_single_post_navigation', 11 );
/**
* Post author bio
*/
function botiga_post_author_bio() {
$single_post_show_author_box = get_theme_mod( 'single_post_show_author_box', 0 );
$single_post_author_box_align = get_theme_mod( 'single_post_author_box_align', 'center' );
if ( !$single_post_show_author_box ) {
return;
}
?>
term_id );
endforeach;
endif;
$query_args = array(
'category__in' => $cat_ids,
'post__not_in' => array( $post_id ),
'posts_per_page' => $single_post_related_posts_number,
);
$related_cats_post = new WP_Query( $query_args );
$wrapper_atts = array();
$wrapper_classes = array( 'botiga-related-posts' );
if( $single_post_related_posts_slider && $single_post_related_posts_number > $single_post_related_posts_columns_number ) {
wp_enqueue_script( 'botiga-carousel' );
$wrapper_classes[] = 'botiga-carousel botiga-carousel-nav2';
if( $single_post_related_posts_slider_nav === 'always-show' ) {
$wrapper_classes[] = 'botiga-carousel-nav2-always-show';
}
$wrapper_atts[] = 'data-per-page="'. absint( $single_post_related_posts_columns_number ) .'"';
}
// Mount related posts wrapper class
$wrapper_atts[] = 'class="'. esc_attr( implode( ' ', $wrapper_classes ) ) .'"';
// Columns class
$column_class = botiga_get_column_class( $single_post_related_posts_columns_number );
if( $related_cats_post->have_posts()) :
echo ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- previously escaped
echo '
';
while( $related_cats_post->have_posts() ): $related_cats_post->the_post(); ?>
';
echo '
';
wp_reset_postdata();
endif;
}
add_action( 'botiga_after_single_post_content', 'botiga_related_posts', 31 );
/**
* Post comments
*/
function botiga_single_post_comments() {
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
}
add_action( 'botiga_after_single_post_content', 'botiga_single_post_comments', 41 );