'; } } add_action('blogbaster_before_index_loop','blogbaster_blog_wrap_start'); function blogbaster_blog_wrap_end(){ if ( get_theme_mod( 'blog_layout' ) == 'grid' ) { echo ''; } if( get_theme_mod( 'blog_pagination_mode' ) == 'numeric' ){ the_posts_pagination(); } else{ the_posts_navigation(); } } add_action('blogbaster_after_index_loop','blogbaster_blog_wrap_end'); function blogbaster_entry_summary(){ global $post; $has_more = strpos( $post->post_content, ''; } if ( get_theme_mod( 'content_boxed' ) == 1 ) { add_action( 'blogbaster_header_before', 'blogbaster_card_wrap_start' ); add_action( 'blogbaster_article_end', 'blogbaster_card_wrap_end' ); } /** * Replaces "[...]" (appended to automatically generated excerpts) with ... * and the read more button. * * @return string link */ function blogbaster_excerpt_more( $link ) { if ( is_admin() ) { return $link; } if ( '' != get_theme_mod( 'more_link' ) ) { $link = '...'; } else { $link = '...'; } return $link; } add_filter( 'excerpt_more', 'blogbaster_excerpt_more' ); function blogbaster_more_link($more_link, $more_link_text) { if ( '' != get_theme_mod( 'more_link' ) ) { $link_txt = esc_html( get_theme_mod( 'more_link' ) ); return str_replace($more_link_text, $link_txt, $more_link); } else { return false; } } add_filter('the_content_more_link', 'blogbaster_more_link', 10, 2); /** * Responsive Image class from Bootstrap * which appended to automatically generated image classes */ function blogbaster_bootstrap_class_images( $html ){ $classes = 'img-fluid'; // separated by spaces, e.g. 'img image-link' // check if there are already classes assigned to the anchor if ( preg_match('/)/', '$1 ' . $classes . '$2', $html); } else { $html = preg_replace('/()/', '$1 class="' . $classes . '"$2', $html); } return $html; } add_filter( 'the_content','blogbaster_bootstrap_class_images', 10 ); /** * Added table class from Bootstrap */ function blogbaster_bootstrap_table_class( $content ){ return str_replace( '
'; } function blogbaster_comment_form_wrap_end(){ echo '
'; } add_action( 'comment_form_after', 'blogbaster_comment_form_wrap_end' ); add_action( 'comment_form_before', 'blogbaster_comment_form_wrap_start' ); /** * Add custom class to comment reply link. */ function blogbaster_comment_reply_link( $content ) { $extra_classes = 'btn btn-primary'; return preg_replace( '/comment-reply-link/', 'comment-reply-link ' . $extra_classes, $content ); } add_filter( 'comment_reply_link', 'blogbaster_comment_reply_link', 99 ); /** * Custom Excerpt lengths. */ function blogbaster_custom_excerpt_length($length) { if ( is_admin() ) { return $length; } return 32; } add_filter( 'excerpt_length', 'blogbaster_custom_excerpt_length' ); /** * Use front-page.php when Front page displays is set to a static page. * * @param string $template front-page.php. * @return string The template to be used: blank if is_home() is true (defaults to index.php), else $template. */ function blogbaster_front_page( $template ) { return is_home() ? '' : $template; } add_filter( 'frontpage_template', 'blogbaster_front_page' ); /** * * Return an alternative title, without prefix * for every type used in the get_the_archive_title() * */ function blogbaster_archive_title( $title ) { if ( is_category() ) { $title = single_cat_title( '', false ); } elseif ( is_tag() ) { $title = single_tag_title( '#', false ); } elseif ( is_author() ) { $title = '' . get_the_author() . ''; } elseif ( is_year() ) { $title = get_the_date( 'Y' ); } elseif ( is_month() ) { $title = get_the_date( 'F Y' ); } elseif ( is_day() ) { $title = get_the_date( get_option( 'date_format' ) ); } elseif ( is_tax( 'post_format' ) ) { if ( is_tax( 'post_format', 'post-format-aside' ) ) { $title = esc_html( _x( 'Asides', 'post format archive title', 'blogbaster' ) ); } elseif ( is_tax( 'post_format', 'post-format-gallery' ) ) { $title = esc_html( _x( 'Galleries', 'post format archive title', 'blogbaster' ) ); } elseif ( is_tax( 'post_format', 'post-format-image' ) ) { $title = esc_html( _x( 'Images', 'post format archive title', 'blogbaster' ) ); } elseif ( is_tax( 'post_format', 'post-format-video' ) ) { $title = esc_html( _x( 'Videos', 'post format archive title', 'blogbaster' ) ); } elseif ( is_tax( 'post_format', 'post-format-quote' ) ) { $title = esc_html( _x( 'Quotes', 'post format archive title', 'blogbaster' ) ); } elseif ( is_tax( 'post_format', 'post-format-link' ) ) { $title = esc_html( _x( 'Links', 'post format archive title', 'blogbaster' ) ); } elseif ( is_tax( 'post_format', 'post-format-status' ) ) { $title = esc_html( _x( 'Statuses', 'post format archive title', 'blogbaster' ) ); } elseif ( is_tax( 'post_format', 'post-format-audio' ) ) { $title = esc_html( _x( 'Audio', 'post format archive title', 'blogbaster' ) ); } elseif ( is_tax( 'post_format', 'post-format-chat' ) ) { $title = esc_html( _x( 'Chats', 'post format archive title', 'blogbaster' ) ); } } elseif ( is_post_type_archive() ) { $title = post_type_archive_title( '', false ); } elseif ( is_tax() ) { $title = single_term_title( '', false ); } else { $title = __( 'Archives', 'blogbaster' ); } return $title; } add_filter( 'get_the_archive_title', 'blogbaster_archive_title' );