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( 'bizroot_simple_breadcrumb' ) ) : /** * Simple breadcrumb. * * @since 1.0.0 */ function bizroot_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( 'bizroot_fonts_url' ) ) : /** * Return fonts URL. * * @since 1.0.0 * @return string Font URL. */ function bizroot_fonts_url() { $fonts_url = ''; $fonts = array(); $subsets = 'latin,latin-ext'; /* translators: If there are characters in your language that are not supported by PT Sans, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'PT Sans font: on or off', 'bizroot' ) ) { $fonts[] = 'PT Sans:400,700,900,400italic,700italic,900italic'; } 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( 'bizroot_get_sidebar_options' ) ) : /** * Get sidebar options. * * @since 1.0.0 */ function bizroot_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( 'bizroot_primary_navigation_fallback' ) ) : /** * Fallback for primary navigation. * * @since 1.0.0 */ function bizroot_primary_navigation_fallback() { echo ''; } endif; if ( ! function_exists( 'bizroot_the_custom_logo' ) ) : /** * Render logo. * * @since 2.0 */ function bizroot_the_custom_logo() { if ( function_exists( 'the_custom_logo' ) ) { the_custom_logo(); } else { $site_logo = bizroot_get_option( 'site_logo' ); if ( ! empty( $site_logo ) ) { ?> <?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?> '', '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;