$value ) {
list( $r, $g, $b ) = $value;
$color_vars[] = "--{$color}: {$r},{$g},{$b}";
}
?>
post_title, $post );
}
} else {
$title = get_the_title();
}
echo $title;
}
function breevia_post_comments_template( $form = '' ) {
return get_template_directory() . '/template-parts/blog/comments.php';
}
function breevia_post_comments( $attrs = array() ) {
ob_start();
if ( comments_open( get_the_ID() ) ) {
breevia_theme()->setState( 'comments_template_data', $attrs );
add_filter( 'comments_template', 'breevia_post_comments_template' );
comments_template();
remove_filter( 'comments_template', 'breevia_post_comments_template' );
} else {
echo $attrs['disabled'];
}
$content = ob_get_clean();
echo $content;
}
function breevia_post_excerpt_length( $length ) {
$length = breevia_theme()->getState( 'post_excerpt_length', $length );
breevia_theme()->deleteState( 'post_excerpt_length' );
return $length;
}
function breevia_post_excerpt( $attrs = array() ) {
if ( isset( $attrs['max_length'] ) ) {
breevia_theme()->setState( 'post_excerpt_length', $attrs['max_length'] );
}
add_filter( 'excerpt_length', 'breevia_post_excerpt_length' );
echo get_the_excerpt();
breevia_theme()->deleteState( 'post_excerpt_length' );
remove_filter( 'excerpt_length', 'breevia_post_excerpt_length' );
}
function breevia_post_missing_featured_image_class() {
if ( has_post_thumbnail() ) {
echo '';
} else {
echo 'kubio-post-featured-image--image-missing';
}
}
function breevia_get_navigation_button_link( $prev = false ) {
if ( is_single() ) {
breevia_get_single_post_nav_button_link( $prev );
}
breevia_get_archive_post_nav_button_link( $prev );
}
function breevia_get_single_post_nav_button_link( $prev = false ) {
$post = get_adjacent_post( false, '', $prev, 'category' );
echo esc_url( get_permalink( $post ) );
}
function breevia_get_archive_post_nav_button_link( $prev = false ) {
if ( $prev ) {
echo get_previous_posts_page_link();
} else {
echo get_next_posts_page_link();
}
}
function breevia_has_pagination() {
if ( is_single() ) {
$prev_post = get_adjacent_post();
$next_post = get_adjacent_post( false, ',true' );
return ( $prev_post instanceof WP_Post || $next_post instanceof WP_Post );
}
global $wp_query;
$total = isset( $wp_query->max_num_pages ) ? $wp_query->max_num_pages : 1;
return ( $total > 1 );
}
function breevia_has_pagination_button( $prev = false ) {
if ( is_single() ) {
$post = get_adjacent_post( false, '', $prev, 'category' );
return ( $post instanceof WP_Post );
}
global $wp_query;
$total = isset( $wp_query->max_num_pages ) ? $wp_query->max_num_pages : 1;
$current = get_query_var( 'paged' ) ? (int) get_query_var( 'paged' ) : 1;
if ( $prev ) {
return ( $current > 1 );
} else {
return ( intval( $current ) < intval( $total ) );
}
}
function breevia_pagination_numbers() {
echo paginate_links(
array(
'prev_next' => false,
'show_all' => false,
)
);
}
function breevia_tags_list( $placeholder = '' ) {
$post_tags = get_the_tags();
if ( ! empty( $post_tags ) ) {
$output = '';
foreach ( $post_tags as $tag ) {
$output .= '
' . $tag->name . '';
}
$output = trim( $output );
$output .= '
';
echo $output;
} else {
echo $placeholder;
}
}
function breevia_categories_list( $placeholder = '' ) {
$categories = get_the_category();
if ( ! empty( $categories ) ) {
$output = '';
foreach ( $categories as $category ) {
$output .= '
' . $category->name . '';
}
$output = trim( $output );
$output .= '
';
echo $output;
} else {
echo $placeholder;
}
}
function breevia_print_archive_entry_class( $class = '' ) {
$classes = array( 'post-list-item', 'h-col-xs-12', 'space-bottom' );
$classes = array_merge( $classes, explode( ' ', $class ) );
$classes = get_post_class( $classes );
$default = get_theme_mod( 'blog_posts_per_row', Defaults::get( 'blog_posts_per_row' ) );
$postsPerRow = max( 1, apply_filters( 'colibriwp_posts_per_row', $default ) );
$classes[] = 'h-col-sm-12 h-col-md-' . ( 12 / intval( $postsPerRow ) );
$classes = apply_filters( 'colibriwp_archive_entry_class', $classes );
$classesText = implode( ' ', $classes );
echo esc_attr( $classesText );
}