posts && is_archive() ) { $classes[] = 'archive-no-results'; } return $classes; } add_filter( 'body_class', 'genesis_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.8.0 * * @param array $classes Existing body classes. * @return array Amended body classes. */ function genesis_style_selector_body_classes( array $classes ) { $current = genesis_get_option( 'style_selection' ); if ( $current ) { $classes[] = $current; } return $classes; } add_filter( 'body_class', 'genesis_cpt_archive_body_class', 15 ); /** * Adds a custom class to the custom post type archive body classes. * * It accepts a value from the archive settings page. * * @since 2.0.0 * * @param array $classes Existing body classes. * @return array Amended body classes. */ function genesis_cpt_archive_body_class( array $classes ) { if ( ! is_post_type_archive() || ! genesis_has_post_type_archive_support() ) { return $classes; } $new_class = genesis_get_cpt_option( 'body_class' ); if ( $new_class ) { $classes[] = $new_class; } return $classes; } add_action( 'genesis_after_content', 'genesis_get_sidebar' ); /** * Output the sidebar.php file if layout allows for it. * * @since 1.0.0 */ function genesis_get_sidebar() { $site_layout = genesis_site_layout(); // Don't load sidebar on pages that don't need it. if ( 'full-width-content' === $site_layout ) { return; } get_sidebar(); } add_action( 'genesis_after_content_sidebar_wrap', 'genesis_get_sidebar_alt' ); /** * Output the sidebar_alt.php file if layout allows for it. * * @since 1.0.0 */ function genesis_get_sidebar_alt() { $site_layout = genesis_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' ); }