ID, 'business_way_theme_settings', true ); if ( isset( $post_options['post_layout'] ) && ! empty( $post_options['post_layout'] ) ) { $global_layout = $post_options['post_layout']; } } $classes[] = 'global-layout-' . esc_attr( $global_layout ); // Common class for three columns. switch ( $global_layout ) { case 'three-columns': $input[] = 'three-columns-enabled'; break; default: break; } return $classes; } endif; add_filter( 'body_class', 'business_way_body_classes' ); if ( ! function_exists( 'business_way_pingback_header' ) ) : /** * Add a pingback url auto-discovery header for singularly identifiable articles. * * @since 1.0.0 */ function business_way_pingback_header() { if ( is_singular() && pings_open() ) { echo ''; } } endif; add_action( 'wp_head', 'business_way_pingback_header' ); if ( ! function_exists( 'business_way_implement_excerpt_length' ) ) : /** * Implement excerpt length. * * @since 1.0.0 * * @param int $length The number of words. * @return int Excerpt length. */ function business_way_implement_excerpt_length( $length ) { if ( is_admin() ) { return $length; } $excerpt_length = business_way_get_option( 'excerpt_length' ); if ( absint( $excerpt_length ) > 0 ) { $length = absint( $excerpt_length ); } return $length; } endif; add_filter( 'excerpt_length', 'business_way_implement_excerpt_length', 999 ); if ( ! function_exists( 'business_way_implement_read_more' ) ) : /** * Implement read more in excerpt. * * @since 1.0.0 * * @param string $more The string shown within the more link. * @return string The excerpt. */ function business_way_implement_read_more( $more ) { if ( is_admin() ) { return $more; } $read_more_text = business_way_get_option( 'read_more_text' ); if ( ! empty( $read_more_text ) ) { $more = ' ' . esc_html( $read_more_text ) . ''; } return $more; } endif; add_filter( 'excerpt_more', 'business_way_implement_read_more' ); if ( ! function_exists( 'business_way_content_more_link' ) ) : /** * Implement read more in content. * * @since 1.0.0 * * @param string $more_link Read More link element. * @param string $more_link_text Read More text. * @return string Link. */ function business_way_content_more_link( $more_link, $more_link_text ) { $read_more_text = business_way_get_option( 'read_more_text' ); if ( ! empty( $read_more_text ) ) { $more_link = str_replace( $more_link_text, esc_html( $read_more_text ), $more_link ); } return $more_link; } endif; add_filter( 'the_content_more_link', 'business_way_content_more_link', 10, 2 );