array( 'label' => __( 'Content-Sidebar', 'bizznis' ), 'img' => $url . 'cs.png', 'default' => is_rtl() ? false : true, ), 'sidebar-content' => array( 'label' => __( 'Sidebar-Content', 'bizznis' ), 'img' => $url . 'sc.png', 'default' => is_rtl() ? true : false, ), 'content-sidebar-sidebar' => array( 'label' => __( 'Content-Sidebar-Sidebar', 'bizznis' ), 'img' => $url . 'css.png', ), 'sidebar-sidebar-content' => array( 'label' => __( 'Sidebar-Sidebar-Content', 'bizznis' ), 'img' => $url . 'ssc.png', ), 'sidebar-content-sidebar' => array( 'label' => __( 'Sidebar-Content-Sidebar', 'bizznis' ), 'img' => $url . 'scs.png', ), 'full-width-content' => array( 'label' => __( 'Full Width Content', 'bizznis' ), 'img' => $url . 'c.png', ), ), $url ); foreach ( (array) $layouts as $layout_id => $layout_args ) { bizznis_register_layout( $layout_id, $layout_args ); } } endif; add_action( 'bizznis_after_content', 'bizznis_get_sidebar' ); /** * Output the sidebar.php file if layout allows for it. * * @since 1.0.0 */ if ( ! function_exists( 'bizznis_get_sidebar' ) ) : function bizznis_get_sidebar() { $site_layout = bizznis_site_layout(); # Don't load sidebar on pages that don't need it if ( $site_layout == 'full-width-content' ) { return; } get_sidebar(); } endif; add_action( 'bizznis_after_content_sidebar_wrap', 'bizznis_get_sidebar_alt', 15 ); /** * Output the sidebar_alt.php file if layout allows for it. * * @since 1.0.0 */ if ( ! function_exists( 'bizznis_get_sidebar_alt' ) ) : function bizznis_get_sidebar_alt() { $site_layout = bizznis_site_layout(); # Don't load sidebar-alt on pages that don't need it if ( in_array( $site_layout, array( 'content-sidebar', 'sidebar-content', 'full-width-content' ) ) ) { return; } get_sidebar( 'alt' ); } endif; add_filter( 'body_class', 'bizznis_custom_body_class', 15 ); /** * Add custom field body class(es) to the body classes. * * @since 1.0.0 */ if ( ! function_exists( 'bizznis_custom_body_class' ) ) : function bizznis_custom_body_class( array $classes ) { # It accepts values from a per-post or per-page custom field, and only outputs when viewing a singular page. $new_class = is_singular() ? bizznis_get_custom_field( '_bizznis_custom_body_class' ) : null; if ( $new_class ) { $classes[] = $new_class; } return $classes; } endif; add_filter( 'body_class', 'bizznis_header_body_classes' ); /** * Add header-* classes to the body class. We can use pseudo-variables in our CSS file, which helps us achieve multiple header layouts with minimal code. * * @since 1.0.0 */ if ( ! function_exists( 'bizznis_header_body_classes' ) ) : function bizznis_header_body_classes( array $classes ) { if ( current_theme_supports( 'custom-header' ) ) { if ( get_theme_support( 'custom-header', 'default-text-color' ) != get_header_textcolor() || get_theme_support( 'custom-header', 'default-image' ) != get_header_image() ) { $classes[] = 'custom-header'; } } if ( 'image' == bizznis_get_option( 'blog_title' ) || ( current_theme_supports( 'custom-header' ) && ! display_header_text() ) ) { $classes[] = 'header-image'; } if ( ! is_active_sidebar( 'header-aside' ) && ! has_action( 'bizznis_header_aside' ) ) { $classes[] = 'header-full-width'; } return $classes; } endif; add_filter( 'body_class', 'bizznis_background_body_classes' ); /** * Add background-* classes to the body class. We can use pseudo-variables in our CSS file, which helps us achieve multiple background layouts with minimal code. * * @since 1.0.0 */ if ( ! function_exists( 'bizznis_background_body_classes' ) ) : function bizznis_background_body_classes( array $classes ) { if ( current_theme_supports( 'custom-background' ) ) { if ( get_theme_mod( 'background_color' ) || get_background_image() ) { $classes[] = 'custom-background-active'; } } return $classes; } endif; add_filter( 'body_class', 'bizznis_layout_body_classes' ); /** * Add site layout classes to the body classes. We can use pseudo-variables in our CSS file, which helps us achieve multiple site layouts with minimal code. * * @since 1.0.0 */ if ( ! function_exists( 'bizznis_layout_body_classes' ) ) : function bizznis_layout_body_classes( array $classes ) { $site_layout = bizznis_site_layout(); if ( $site_layout ) { $classes[] = $site_layout; } return $classes; } endif; add_filter( 'body_class', 'bizznis_archive_no_results_body_class' ); /** * Add archive-no-results body class on empty archive pages * * Allows CSS styling of resultless archive pages * * @since 2.2.0 * * @global WP_Query $wp_query Query object. * @param array $classes Existing classes. * @return array Amended classes */ if ( ! function_exists( 'bizznis_archive_no_results_body_class' ) ) : function bizznis_archive_no_results_body_class( array $classes ) { global $wp_query; if ( is_archive() && ! $wp_query->posts ) { $classes[] = 'archive-no-results'; } return $classes; } endif; add_filter( 'body_class', 'bizznis_style_selector_body_classes' ); /** * Add style selector classes to the body classes. * * Enables style selector support in child themes, which helps us achieve multiple site styles with minimal code. * * @since 1.0.0 */ if ( ! function_exists( 'bizznis_style_selector_body_classes' ) ) : function bizznis_style_selector_body_classes( array $classes ) { $current = bizznis_get_option( 'style_selection' ); if ( $current ) { $classes[] = $current; } return $classes; } endif; add_filter( 'content_width', 'bizznis_content_width', 10, 3 ); /** * Filter the content width based on the user selected layout. * * @since 1.0.0 */ if ( ! function_exists( 'bizznis_content_width' ) ) : function bizznis_content_width( $default, $small, $large ) { switch ( bizznis_site_layout( 0 ) ) { case 'full-width-content': $width = $large; break; case 'content-sidebar-sidebar': case 'sidebar-content-sidebar': case 'sidebar-sidebar-content': $width = $small; break; default: $width = $default; } return $width; } endif; /** * Remove Gallery Inline Styling, generated by WordPress * * @since 1.0.5 */ add_filter( 'use_default_gallery_style', '__return_false' );