theme_location == 'bfastmag-primary' ) { $home = ''; $items = $home . $items; } return $items; } /** * Sets the Magazine Template Instead of front-page. */ function bfastmag_fp_template_set( $template ) { $bfastmag_set_original_fp = get_theme_mod( 'bfastmag_set_original_fp' ,false); if ( $bfastmag_set_original_fp ) { return is_home() ? '' : $template; } else { return ''; } } add_filter( 'frontpage_template', 'bfastmag_fp_template_set' ); /** * Excerpt **/ function bfastmag_excerpt($limit) { return wp_trim_words(get_the_excerpt(), $limit); } add_filter('wp_list_categories', 'bfastmag_cat_count_span'); function bfastmag_cat_count_span($links) { $links = str_replace(' (', ' ', $links); $links = str_replace(')', '', $links); return $links; } /** * Callback function for comment form **/ function bfastmag_comment( $comment, $args, $depth ) { if ( 'div' === $args['style'] ) { $tag = 'div '; $add_below = 'comment bfast-mag-comment'; } else { $tag = 'li '; $add_below = 'div-comment bfast-mag-comment'; } ?> < id="comment-">
Recent Posts */ /** * Heading of comments. */ function bfastmag_comments_heading() { $comments_number = get_comments_number(); if ( 1 === $comments_number ) { /* translators: %s: post title */ printf( _x( ' %1$s Comment', 'comments title','bfastmag' ),''.number_format_i18n( $comments_number ) ); } else { printf( /* translators: 1: number of comments */ _nx( '%1$s Comment', '%1$s Comments', $comments_number, 'comments title', 'bfastmag' ), ''.number_format_i18n( $comments_number ) ); } } add_action( 'bfastmag_comments_title','bfastmag_comments_heading' ); /** * Comment action. * * @param string $args Comment arguments. * @param object $comment Comment object. * @param int $depth Comments depth. * @param string $add_below Add bellow comments. */ function bfastmag_comment_action( $args, $comment, $depth, $add_below ) { ?>
%1$s(%2$s - %3$s)','bfastmag' ), get_comment_author_link(), get_comment_date(), get_comment_time(),get_comment_link() ); ?>
comment_approved == '0' ) : ?>
'; } add_action( 'comment_form_after_fields', 'bfastmag_after_comment_fields' ); /** * Creates a closing div for a bootstrap row. * * @global int $comment_open_div * @return type */ function bfastmag_after_comment_fields() { global $comment_open_div; if ( $comment_open_div == 0 ) { return; } echo ''; } /** * Jetpack Compatibility File. * * Jetpack setup function. * * See: https://jetpack.me/support/infinite-scroll/ * See: https://jetpack.me/support/responsive-videos/ * @link https://jetpack.me/ * * @package bfastmag */ function bfastmag_jetpack_setup() { // Add theme support for Infinite Scroll. add_theme_support( 'infinite-scroll', array( 'container' => 'main', 'render' => 'bfastmag_infinite_scroll_render', 'footer' => 'page', ) ); // Add theme support for Responsive Videos. add_theme_support( 'jetpack-responsive-videos' ); } // end function bfastmag_jetpack_setup add_action( 'after_setup_theme', 'bfastmag_jetpack_setup' ); /** * Custom render function for Infinite Scroll. */ function bfastmag_infinite_scroll_render() { while ( have_posts() ) { the_post(); get_template_part( 'template-parts/content', get_post_format() ); } } /** * Adds custom classes to the array of body classes. * * @param array $classes Classes for the body element. * @return array */ function bfastmag_body_classes( $classes ) { // Adds a class of group-blog to blogs with more than 1 published author. if ( is_multi_author() ) { $classes[] = 'group-blog'; } if ( bfastmag_isprevdem() ) { $classes[] = 'prevpac'; } return $classes; } add_filter( 'body_class', 'bfastmag_body_classes' );