post_content; if ( ! empty( $post_object->post_excerpt ) ) { $source_content = $post_object->post_excerpt; } $source_content = strip_shortcodes( $source_content ); $trimmed_content = wp_trim_words( $source_content, $length, '…' ); return $trimmed_content; } endif; if ( ! function_exists( 'business_buzz_breadcrumb' ) ) : /** * Breadcrumb. * * @since 1.0.0 */ function business_buzz_breadcrumb() { if ( ! function_exists( 'breadcrumb_trail' ) ) { require_once trailingslashit( get_template_directory() ) . 'vendors/breadcrumbs/breadcrumbs.php'; } $breadcrumb_args = array( 'container' => 'div', 'show_browse' => false, ); breadcrumb_trail( $breadcrumb_args ); } endif; if ( ! function_exists( 'business_buzz_fonts_url' ) ) : /** * Return fonts URL. * * @since 1.0.0 * @return string Font URL. */ function business_buzz_fonts_url() { $fonts_url = ''; $fonts = array(); $subsets = 'latin,latin-ext'; /* translators: If there are characters in your language that are not supported by Open Sans, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Open Sans font: on or off', 'business-buzz' ) ) { $fonts[] = 'Open Sans:400,700'; } /* 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 font: on or off', 'business-buzz' ) ) { $fonts[] = 'Poppins:100,400,500,600'; } if ( $fonts ) { $fonts_url = add_query_arg( array( 'family' => urlencode( implode( '|', $fonts ) ), 'subset' => urlencode( $subsets ), ), 'https://fonts.googleapis.com/css' ); } return $fonts_url; } endif; if ( ! function_exists( 'business_buzz_primary_navigation_fallback' ) ) : /** * Fallback for primary navigation. * * @since 1.0.0 */ function business_buzz_primary_navigation_fallback() { echo ''; } endif; if ( ! function_exists( 'business_buzz_the_custom_logo' ) ) : /** * Render logo. * * @since 1.0.0 */ function business_buzz_the_custom_logo() { if ( function_exists( 'the_custom_logo' ) ) { the_custom_logo(); } } endif; if ( ! function_exists( 'business_buzz_render_select_dropdown' ) ) : /** * Render select dropdown. * * @since 1.0.0 * * @param array $main_args Main arguments. * @param string $callback Callback method. * @param array $callback_args Callback arguments. * @return string Rendered markup. */ function business_buzz_render_select_dropdown( $main_args, $callback, $callback_args = array() ) { $defaults = array( 'id' => '', 'name' => '', 'selected' => 0, 'echo' => true, 'add_default' => false, ); $r = wp_parse_args( $main_args, $defaults ); $output = ''; $choices = array(); if ( is_callable( $callback ) ) { $choices = call_user_func_array( $callback, $callback_args ); } if ( ! empty( $choices ) || true === $r['add_default'] ) { $output = "\n"; } if ( $r['echo'] ) { echo $output; } return $output; } endif; if ( ! function_exists( 'business_buzz_get_numbers_dropdown_options' ) ) : /** * Returns numbers dropdown options. * * @since 1.0.0 * * @param int $min Min. * @param int $max Max. * @param string $prefix Prefix. * @param string $suffix Suffix. * @return array Options array. */ function business_buzz_get_numbers_dropdown_options( $min = 1, $max = 4, $prefix = '', $suffix = '' ) { $output = array(); if ( $min <= $max ) { for ( $i = $min; $i <= $max; $i++ ) { $string = $prefix . $i . $suffix; $output[ $i ] = $string; } } return $output; } endif; if ( ! function_exists( 'business_buzz_has_more_tag' ) ) : /** * Check if more tag is in the content. * * @since 1.0.0 * * @return bool Status. */ function business_buzz_has_more_tag() { $output = false; $post = get_post( get_the_ID() ); if ( $post ) { $pos = strpos( $post->post_content, '' ); if ( false !== $pos ) { $output = true; } } return $output; } endif; if ( ! function_exists( 'business_buzz_woocommerce_status' ) ) : /** * Return WooCommerce status. * * @since 1.0.5 * * @return bool Active status. */ function business_buzz_woocommerce_status() { return class_exists( 'WooCommerce' ); } endif;