(.|\n)*?<\/p>/', '

' . get_post_meta( get_the_ID(), 'best_reloaded_featurebar_text', true ) . '

', $html ); } } // return the passed value or updated value. return $html; } } add_filter( 'best_realoaded_filter_featurebar', 'best_realoaded_featuredbar_value_filter' ); if ( ! function_exists( 'best_reloaded_remove_recent_comments_style' ) ) { /** * Removes some inline styles that WP adds alongside the Recent Comments Widget. * * @link Fix from here: https://core.trac.wordpress.org/changeset/16522 * @link Details here: https://core.trac.wordpress.org/ticket/11928 */ function best_reloaded_remove_recent_comments_style() { global $wp_widget_factory; remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) ); add_filter( 'show_recent_comments_widget_style', '__return_false' ); } } add_action( 'widgets_init', 'best_reloaded_remove_recent_comments_style' ); if ( ! function_exists( 'best_reloaded_add_class_the_tags' ) ) { /** * Adds some classes to tags in the wordcloud. * * @param string $html html string to be modified and add the label class_exists. * * @return $html modified string with the label classnames. */ function best_reloaded_add_class_the_tags( $html ) { $postid = get_the_ID(); $html = str_replace( 'id; $field_id = is_admin() || empty( $form ) ? "field_{$id}" : 'field_' . $form['id'] . "_$id"; return '
  • {FIELD_CONTENT}
  • '; } } add_filter( 'gform_field_container', 'best_reloaded_add_bootstrap_container_class_to_gf', 10, 6 ); if ( ! function_exists( 'best_reloaded_jptweak_remove_share' ) ) { /** * Removes the filters that jetpack uses to add the share box to end of posts. */ function best_reloaded_jptweak_remove_share() { remove_filter( 'the_content', 'sharing_display',19 ); remove_filter( 'the_excerpt', 'sharing_display',19 ); remove_filter( 'the_content', array( 'Jetpack_Likes', 'post_likes' ), 30, 1 ); } } add_action( 'loop_end', 'best_reloaded_jptweak_remove_share' ); if ( ! function_exists( 'best_reloaded_output_navbar_brand' ) ) { /** * Echos the markup output by navbar branding function. * * @since v1.2.0 * * @return void */ function best_reloaded_output_navbar_brand() { // try get the branding markup. $output = best_reloaded_bootstrap_navbar_branding(); // if we have output to use then echo it. if ( $output ) { $allowed_brand_tags = array( 'span' => array( 'class' => array(), ), 'img' => array( 'id' => array(), 'class' => array(), 'src' => array(), 'alt' => array(), ), ); echo wp_kses( apply_filters( 'best_reloaded_filter_navbar_brand', $output ), $allowed_brand_tags ); } } } add_action( 'best_reloaded_do_navbar_brand', 'best_reloaded_output_navbar_brand' ); if ( ! function_exists( 'best_reloaded_output_post_meta' ) ) { /** * Returns or echos some entry meta based on conditionals. * NOTE: Will fail silently. * * @param boolean $echo flag to indicate echo or return. * @param string $type string indicating type of meta we want, can be FALSE. * * @return string/void Can return either a string or nothing if echoing. */ function best_reloaded_output_post_meta( $echo = true, $type = false ) { // if no specific type was requested, figure it out. // NOTE: due to a quirk of using a front-page.php template `is_home()` and // `is_front_page()` are true when no static page is set. Test that first. if ( is_home() && is_front_page() ) { $type = 'front-page'; } elseif ( is_home() ) { $type = 'home'; } elseif ( is_front_page() ) { $type = 'front-page'; } elseif ( is_single() && ! is_singular( 'page' ) ) { $type = 'single'; } $output = ''; // if $type is single OR no type is passed and it is single but not a page... if ( 'single' === $type ) { ob_start(); ?>
    '); } else { /** * This is the themes built in breadcrumbs feature, it's in need of * improvement but it fills the space when yoast is not available. */ global $post; $defaults = array( 'separator_icon' => '>', 'breadcrumbs_id' => 'breadcrumbs', 'breadcrumbs_classes' => 'breadcrumb-trail breadcrumbs', 'home_title' => esc_html( 'Home', 'best-reloaded' ), ); $args = wp_parse_args( $args, $defaults ); $separator = ' ' . esc_html( $args['separator_icon'] ) . ' '; // Open a wrapper. $html = '
    '; // Open the breadcrumbs. $html .= '

    '; // Add Homepage link & separator (always present). $html .= '' . esc_html( $args['home_title'] ) . ''; $html .= $separator; // Post. if ( is_singular( 'post' ) ) { $category = get_the_category( $post->ID ); $category_values = array_values( $category ); $last_category = end( $category_values ); $cat_parents = rtrim( get_category_parents( $last_category->term_id, true, ',' ), ',' ); $cat_parents = explode( ',', $cat_parents ); foreach ( $cat_parents as $parent ) { $html .= '' . wp_kses( $parent, wp_kses_allowed_html( 'a' ) ) . ''; $html .= $separator; } $html .= '' . wp_strip_all_tags( get_the_title() ) . ''; } elseif ( is_singular( 'page' ) ) { if ( $post->post_parent ) { $parents = get_post_ancestors( $post->ID ); $parents = array_reverse( $parents ); foreach ( $parents as $parent ) { $html .= '' . wp_strip_all_tags( get_the_title( $parent ) ) . ''; $html .= $separator; } } $html .= ' ' . wp_strip_all_tags( get_the_title() ) . ''; } elseif ( is_singular( 'attachment' ) ) { $parent_id = $post->post_parent; $parent_title = get_the_title( $parent_id ); $parent_permalink = esc_url( get_permalink( $parent_id ) ); $html .= '' . wp_strip_all_tags( $parent_title ) . ''; $html .= $separator; $html .= ' ' . wp_strip_all_tags( get_the_title() ) . ''; } elseif ( is_singular() ) { $post_type = get_post_type( $post->ID ); $post_type_object = get_post_type_object( $post_type ); $post_type_archive = get_post_type_archive_link( $post_type ); $html .= '' . wp_strip_all_tags( $post_type_object->labels->name ) . ''; $html .= $separator; $html .= '' . wp_strip_all_tags( $post->post_title ) . ''; } elseif ( is_category() ) { $parent = get_queried_object()->category_parent; if ( 0 !== $parent ) { $parent_category = get_category( $parent ); $category_link = get_category_link( $parent ); $html .= '' . esc_html( $parent_category->name ) . ''; $html .= $separator; } $html .= '' . single_cat_title( '', false ) . ''; } elseif ( is_tag() ) { $html .= '' . single_tag_title( '', false ) . ''; } elseif ( is_author() ) { $html .= '' . get_queried_object()->display_name . ''; } elseif ( is_day() ) { $html .= '' . get_the_date() . ''; } elseif ( is_month() ) { $html .= '' . get_the_date( 'F Y' ) . ''; } elseif ( is_year() ) { $html .= '' . get_the_date( 'Y' ) . ''; } elseif ( is_archive() ) { $custom_tax_name = get_queried_object()->name; $html .= '' . esc_html( $custom_tax_name ) . ''; } elseif ( is_search() ) { $html .= 'Search results for: ' . get_search_query() . ''; } elseif ( is_404() ) { $html .= '' . __( 'Error 404', 'best-reloaded' ) . ''; } elseif ( is_home() ) { $html .= '' . esc_html( get_the_title( get_option( 'page_for_posts' ) ) ) . ''; } // End if(). $html .= '

    '; $html .= '
    '; echo wp_kses_post( $html ); } // End if(). } } // End if(). add_action( 'best_reloaded_do_before_main_content_row', 'best_reloaded_do_breadcrumbs' );