';
foreach ( $content_socialbtns as $button ) {
if ( ! array_key_exists( $button, $social_networks ) ) {
continue;
}
$network = $social_networks[ $button ];
$options = get_theme_mod( 'content_socialbtns_options' );
$btn_classes = array( 'button', 'is-' . $button );
if ( in_array( 'rounded', $options, true ) ) {
$btn_classes[] = 'is-circular';
}
if ( in_array( 'outlined', $options, true ) ) {
$btn_classes[] = 'is-outlined';
}
if ( in_array( 'shadow', $options, true ) ) {
$btn_classes[] = 'has-shadow';
}
if ( in_array( 'label', $options, true ) ) {
$btn_classes[] = 'has-label';
}
if ( in_array( 'size_md', $options, true ) ) {
$btn_classes[] = 'is-medium';
}
?>
>
';
}
endif;
if ( ! function_exists( 'treviso_posts_navigation' ) ) :
/**
* Prints HTML for numeric post navigation buttons.
*/
function treviso_posts_navigation() {
if ( is_singular() ) {
the_post_navigation(
array(
'next_text' => '
Next Up:
%title',
'prev_text' => '
Previously:
%title',
)
);
return;
}
global $wp_query;
// Stop execution if there's only 1 page.
if ( $wp_query->max_num_pages <= 1 ) {
return;
}
$paged = get_query_var( 'paged' ) ? absint( get_query_var( 'paged' ) ) : 1;
$max = intval( $wp_query->max_num_pages );
// Add current page to the array.
if ( $paged >= 1 ) {
$links[] = $paged;
}
// Add the pages around the current page to the array.
if ( $paged >= 3 ) {
$links[] = $paged - 1;
$links[] = $paged - 2;
}
if ( ( $paged + 2 ) <= $max ) {
$links[] = $paged + 2;
$links[] = $paged + 1;
}
echo '' . "\n";
}
endif;
if ( ! function_exists( 'treviso_comments' ) ) :
/**
* Prints HTML for the custom comments.
*
* @param object $comment The current comment.
* @param array $args Arguments for the comments.
* @param int $depth Depth of nested comments.
*/
function treviso_comments( $comment, $args, $depth ) {
if ( $depth > 1 ) {
$size_class = 'is-32x32';
} else {
$size_class = 'is-48x48';
}
?>
'',
'title_reply_before' => '',
'cancel_reply_before' => '
',
'cancel_reply_after' => '
',
'fields' => apply_filters(
'treviso_comment_form_default_fields',
array(
'author' => '',
'email' => '',
'url' => '',
'cookies' => '',
)
),
);
comment_form( $args );
}
endif;
if ( ! function_exists( 'treviso_back_to_top' ) ) :
/**
* Prints HTML for the Back To Top button.
*/
function treviso_back_to_top() {
if ( ! empty( get_theme_mod( 'btt_btnimage' ) ) ) {
printf(
'
',
esc_url( get_theme_mod( 'btt_btnimage' ) ),
esc_attr__( 'Back to top', 'treviso' )
);
} else {
echo '
';
}
echo '
' . esc_html__( 'Back to top', 'treviso' ) . '';
}
endif;