post_content, '';
}
add_action( 'bigwigs_header_before', 'bigwigs_card_wrap_start' );
add_action( 'bigwigs_article_end', 'bigwigs_card_wrap_end' );
/**
* Replaces "[...]" (appended to automatically generated excerpts) with ...
* and the read more button.
*
* @return string link
*/
function bigwigs_excerpt_more( $link ) {
if ( is_admin() ) {
return $link;
}
if ( '' != get_theme_mod( 'more_link' ) ) {
$link = '...';
} else {
$link = '...';
}
return $link;
}
add_filter( 'excerpt_more', 'bigwigs_excerpt_more' );
function bigwigs_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', 'bigwigs_more_link', 10, 2);
/**
* Responsive Image class from Bootstrap
* which appended to automatically generated image classes
*/
function bigwigs_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','bigwigs_bootstrap_class_images', 10 );
/**
* Added table class from Bootstrap
*/
function bigwigs_bootstrap_table_class( $content ){
return str_replace( '
';
}
function bigwigs_comment_form_wrap_end(){
echo '
';
}
add_action( 'comment_form_after', 'bigwigs_comment_form_wrap_end' );
add_action( 'comment_form_before', 'bigwigs_comment_form_wrap_start' );
/**
* Add custom class to comment reply link.
*/
function bigwigs_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', 'bigwigs_comment_reply_link', 99 );
/**
* Custom Excerpt lengths.
*/
function bigwigs_custom_excerpt_length($length) {
if ( is_admin() ) {
return $length;
}
return 32;
}
add_filter( 'excerpt_length', 'bigwigs_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 bigwigs_front_page( $template ) {
return is_home() ? '' : $template;
}
add_filter( 'frontpage_template', 'bigwigs_front_page' );
/**
*
* Return an alternative title, without prefix
* for every type used in the get_the_archive_title()
*
*/
function bigwigs_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', 'bigwigs' ) );
} elseif ( is_tax( 'post_format', 'post-format-gallery' ) ) {
$title = esc_html( _x( 'Galleries', 'post format archive title', 'bigwigs' ) );
} elseif ( is_tax( 'post_format', 'post-format-image' ) ) {
$title = esc_html( _x( 'Images', 'post format archive title', 'bigwigs' ) );
} elseif ( is_tax( 'post_format', 'post-format-video' ) ) {
$title = esc_html( _x( 'Videos', 'post format archive title', 'bigwigs' ) );
} elseif ( is_tax( 'post_format', 'post-format-quote' ) ) {
$title = esc_html( _x( 'Quotes', 'post format archive title', 'bigwigs' ) );
} elseif ( is_tax( 'post_format', 'post-format-link' ) ) {
$title = esc_html( _x( 'Links', 'post format archive title', 'bigwigs' ) );
} elseif ( is_tax( 'post_format', 'post-format-status' ) ) {
$title = esc_html( _x( 'Statuses', 'post format archive title', 'bigwigs' ) );
} elseif ( is_tax( 'post_format', 'post-format-audio' ) ) {
$title = esc_html( _x( 'Audio', 'post format archive title', 'bigwigs' ) );
} elseif ( is_tax( 'post_format', 'post-format-chat' ) ) {
$title = esc_html( _x( 'Chats', 'post format archive title', 'bigwigs' ) );
}
} elseif ( is_post_type_archive() ) {
$title = post_type_archive_title( '', false );
} elseif ( is_tax() ) {
$title = single_term_title( '', false );
} else {
$title = __( 'Archives', 'bigwigs' );
}
return $title;
}
add_filter( 'get_the_archive_title', 'bigwigs_archive_title' );