ID, 'boston_business_theme_settings', true ); if ( isset( $post_options['post_layout'] ) && ! empty( $post_options['post_layout'] ) ) { $page_layout = $post_options['post_layout']; } } // Include primary sidebar. if ( 'no-sidebar' !== $page_layout ) { get_sidebar(); } } endif; add_action( 'boston_business_action_sidebar', 'boston_business_add_sidebar' ); if ( ! function_exists( 'boston_business_custom_posts_navigation' ) ) : /** * Posts navigation. * * @since 1.0 */ function boston_business_custom_posts_navigation() { $pagination_type = boston_business_get_option( 'pagination_type' ); switch ( $pagination_type ) { case 'default': the_posts_navigation(); break; case 'numeric': the_posts_pagination(); break; default: break; } } endif; add_action( 'boston_business_action_posts_navigation', 'boston_business_custom_posts_navigation' ); if ( ! function_exists( 'boston_business_add_image_in_single_display' ) ) : /** * Add image in single post. * * @since 1.0 */ function boston_business_add_image_in_single_display() { global $post; // Bail if current post is built with Page Builder. if ( true === boston_business_content_is_pagebuilder() ) { return; } // Bail if checkbox Use Featured Image as Banner is enabled. $values = get_post_meta( $post->ID, 'boston_business_theme_settings', true ); if ( isset( $values['use_featured_image_as_banner'] ) && 1 === absint( $values['use_featured_image_as_banner'] ) ) { return; } if ( has_post_thumbnail() ) { $values = get_post_meta( $post->ID, 'boston_business_theme_settings', true ); $single_image = isset( $values['single_image'] ) ? esc_attr( $values['single_image'] ) : ''; if ( ! $single_image ) { $single_image = boston_business_get_option( 'single_image' ); } if ( 'disable' !== $single_image ) { $args = array( 'class' => 'aligncenter', ); the_post_thumbnail( esc_attr( $single_image ), $args ); } } } endif; add_action( 'boston_business_single_image', 'boston_business_add_image_in_single_display' ); if( ! function_exists( 'boston_business_check_custom_header_status' ) ) : /** * Check status of custom header. * * @since 1.0 */ function boston_business_check_custom_header_status( $input ) { global $post; if ( is_front_page() && 'posts' === get_option( 'show_on_front' ) ) { $input = false; } else if ( is_home() && ( $blog_page_id = boston_business_get_index_page_id( 'blog' ) ) > 0 ) { $values = get_post_meta( $blog_page_id, 'boston_business_theme_settings', true ); $disable_banner_area = isset( $values['disable_banner_area'] ) ? absint( $values['disable_banner_area'] ) : 0; if ( 1 === $disable_banner_area ) { $input = false; } } else if ( $post ) { if ( is_singular() ) { $values = get_post_meta( $post->ID, 'boston_business_theme_settings', true ); $disable_banner_area = isset( $values['disable_banner_area'] ) ? absint( $values['disable_banner_area'] ) : 0; if ( 1 === $disable_banner_area ) { $input = false; } } } return $input; } endif; add_filter( 'boston_business_filter_custom_header_status', 'boston_business_check_custom_header_status' ); if ( ! function_exists( 'boston_business_add_custom_header' ) ) : /** * Add Custom Header. * * @since 1.0 */ function boston_business_add_custom_header() { $flag_apply_custom_header = apply_filters( 'boston_business_filter_custom_header_status', true ); if ( true !== $flag_apply_custom_header ) { return; } $attribute = ''; $attribute = apply_filters( 'boston_business_filter_custom_header_style_attribute', $attribute ); ?>
>
0 ) { $title = get_the_title( $blog_page_id ); } elseif ( is_singular() ) { $title = get_the_title(); } elseif ( is_archive() ) { $title = strip_tags( get_the_archive_title() ); } elseif ( is_search() ) { /* translators: %s: search query input */ $title = sprintf( __( 'Search Results for: %s', 'boston-business' ), get_search_query() ); } elseif ( is_404() ) { $title = __( '404!', 'boston-business' ); } return $title; } endif; add_filter( 'boston_business_filter_custom_page_title', 'boston_business_customize_page_title' ); if ( ! function_exists( 'boston_business_add_image_in_custom_header' ) ) : /** * Add image in Custom Header. * * @since 1.0 */ function boston_business_add_image_in_custom_header( $input ) { $image_details = array(); // For is_home(). if ( is_home() && ( $blog_page_id = boston_business_get_index_page_id( 'blog' ) ) > 0 ) { $values = get_post_meta( $blog_page_id, 'boston_business_theme_settings', true ); $use_featured_image_as_banner = isset( $values['use_featured_image_as_banner'] ) ? absint( $values['use_featured_image_as_banner'] ) : 0; if ( 1 === $use_featured_image_as_banner ) { $image = wp_get_attachment_image_src( get_post_thumbnail_id( $blog_page_id ), 'boston-business-featured-banner' ); if ( ! empty( $image ) ) { $image_details['url'] = $image[0]; $image_details['width'] = $image[1]; $image_details['height'] = $image[2]; } } } // Fetch image info if singular. else if ( is_singular() ) { global $post; $values = get_post_meta( $post->ID, 'boston_business_theme_settings', true ); $use_featured_image_as_banner = isset( $values['use_featured_image_as_banner'] ) ? absint( $values['use_featured_image_as_banner'] ) : 0; if ( 1 === $use_featured_image_as_banner ) { $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'boston-business-featured-banner' ); if ( ! empty( $image ) ) { $image_details['url'] = $image[0]; $image_details['width'] = $image[1]; $image_details['height'] = $image[2]; } } } if ( empty( $image_details ) ) { // Fetch from Custom Header Image. $image = get_header_image(); if ( ! empty( $image ) ) { $image_details['url'] = $image; $image_details['width'] = get_custom_header()->width; $image_details['height'] = get_custom_header()->height; } } if ( ! empty( $image_details ) ) { $input .= 'background-image:url(' . esc_url( $image_details['url'] ) . ');'; $input .= 'background-size:cover;'; } return $input; } endif; add_filter( 'boston_business_filter_custom_header_style_attribute', 'boston_business_add_image_in_custom_header' ); if ( ! function_exists( 'boston_business_add_author_bio_in_single' ) ) : /** * Display Author bio. * * @since 1.0 */ function boston_business_add_author_bio_in_single() { if ( is_singular( 'post' ) ) { global $post; if ( get_the_author_meta( 'description', $post->post_author ) ) { get_template_part( 'template-parts/author-bio', 'single' ); } } } endif; add_action( 'boston_business_author_bio', 'boston_business_add_author_bio_in_single' ); if ( ! function_exists( 'boston_business_primary_navigation_fallback' ) ) : /** * Fallback for primary navigation. * * @since 1.0 */ function boston_business_primary_navigation_fallback() { echo ''; } endif;