post_content; if ( ! empty( $post_obj->post_excerpt ) ) { $source_content = $post_obj->post_excerpt; } $source_content = preg_replace( '`\[[^\]]*\]`', '', $source_content ); $trimmed_content = wp_trim_words( $source_content, $length, '...' ); return $trimmed_content; } endif; if ( ! function_exists( 'boston_business_simple_breadcrumb' ) ) : /** * Simple breadcrumb. * * @since 1.0 */ function boston_business_simple_breadcrumb() { if ( ! function_exists( 'breadcrumb_trail' ) ) { require_once get_template_directory() . '/lib/breadcrumbs/breadcrumbs.php'; } $breadcrumb_args = array( 'container' => 'div', 'show_browse' => false, ); breadcrumb_trail( $breadcrumb_args ); } endif; if ( ! function_exists( 'boston_business_fonts_url' ) ) : /** * Return fonts URL. * * @since 1.0 * @return string Font URL. */ function boston_business_fonts_url() { $fonts_url = ''; $fonts = array(); $subsets = 'latin,latin-ext'; // body fonts /* translators: If there are characters in your language that are not supported by Ubuntu, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Ubuntu: on or off', 'boston-business' ) ) { $fonts[] = 'Ubuntu:300,400,500,700'; } /* translators: If there are characters in your language that are not supported by |News Cycle, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'News Cycle font: on or off', 'boston-business' ) ) { $fonts[] = 'News Cycle'; } /* translators: If there are characters in your language that are not supported by Pontano Sans, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Pontano Sans font: on or off', 'boston-business' ) ) { $fonts[] = 'Pontano Sans'; } /* translators: If there are characters in your language that are not supported by Gudea, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Gudea font: on or off', 'boston-business' ) ) { $fonts[] = 'Gudea'; } /* translators: If there are characters in your language that are not supported by Quattrocento, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Quattrocento font: on or off', 'boston-business' ) ) { $fonts[] = 'Quattrocento'; } /* translators: If there are characters in your language that are not supported by Khand, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Khand font: on or off', 'boston-business' ) ) { $fonts[] = 'Khand'; } // header fonts /* translators: If there are characters in your language that are not supported by Rajdhani, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Rajdhani font: on or off', 'boston-business' ) ) { $fonts[] = 'Rajdhani'; } /* translators: If there are characters in your language that are not supported by Cherry Swash, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Cherry Swash font: on or off', 'boston-business' ) ) { $fonts[] = 'Cherry Swash'; } /* translators: If there are characters in your language that are not supported by Philosopher, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Philosopher font: on or off', 'boston-business' ) ) { $fonts[] = 'Philosopher'; } /* translators: If there are characters in your language that are not supported by Slabo 27px, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Slabo 27px font: on or off', 'boston-business' ) ) { $fonts[] = 'Slabo 27px'; } /* translators: If there are characters in your language that are not supported by Dosis, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Dosis font: on or off', 'boston-business' ) ) { $fonts[] = 'Dosis'; } /* translators: If there are characters in your language that are not supported by Poppins, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Poppins: on or off', 'boston-business' ) ) { $fonts[] = 'Poppins:300,400,500,600,700'; } if ( $fonts ) { $fonts_url = add_query_arg( array( 'family' => urlencode( implode( '|', $fonts ) ), 'subset' => urlencode( $subsets ), ), '//fonts.googleapis.com/css' ); } return $fonts_url; } endif; if ( ! function_exists( 'boston_business_get_sidebar_options' ) ) : /** * Get sidebar options. * * @since 1.0 */ function boston_business_get_sidebar_options() { global $wp_registered_sidebars; $output = array(); if ( ! empty( $wp_registered_sidebars ) && is_array( $wp_registered_sidebars ) ) { foreach ( $wp_registered_sidebars as $key => $sidebar ) { $output[ $key ] = $sidebar['name']; } } return $output; } endif; if ( ! function_exists( 'boston_business_get_index_page_id' ) ) : /** * Get front index page ID. * * @since 1.0 * * @param string $type Type. * @return int Corresponding Page ID. */ function boston_business_get_index_page_id( $type = 'front' ) { $page = ''; switch ( $type ) { case 'front': $page = get_option( 'page_on_front' ); break; case 'blog': $page = get_option( 'page_for_posts' ); break; default: break; } $page = absint( $page ); return $page; } endif; if ( ! function_exists( 'boston_business_content_is_pagebuilder' ) ) : /** * SiteOrigin Page Builder Content Check. * * Conditionally check if the current page/post was created with * the SiteOrigin Page Builder editor. * * @since 1.0 * * @return bool True if builder page. */ function boston_business_content_is_pagebuilder() { global $post; // Consider empty content the WP editor. if ( empty( $post ) ) { return false; } // Does pagebuilder content exist in custom fields? $panels_data = get_post_meta( $post->ID, 'panels_data', true ); return ( empty( $panels_data ) ) ? false : true; } endif; if ( ! function_exists( 'boston_business_the_custom_logo' ) ) : /** * Render logo. * * @since 1.0 */ function boston_business_the_custom_logo() { if ( function_exists( 'the_custom_logo' ) ) { the_custom_logo(); } } endif;