>
>
ID, 'cyberchimps_page_sidebar' ); $layout_type = ( isset( $page_sidebar[0] ) ) ? $page_sidebar[0] : 'right_sidebar'; } elseif( is_plugin_active( 'woocommerce/woocommerce.php' ) && is_woocommerce() && is_shop() ) { $page_sidebar = get_post_meta( woocommerce_get_page_id( 'shop' ), 'cyberchimps_page_sidebar' ); $layout_type = ( isset( $page_sidebar[0] ) ) ? $page_sidebar[0] : 'right_sidebar'; } elseif( is_archive() ) { $layout_type = cyberchimps_get_option( 'archive_sidebar_options', 'right_sidebar' ); } elseif( is_search() ) { $layout_type = cyberchimps_get_option( 'search_sidebar_options', 'right_sidebar' ); } elseif( is_404() ) { $layout_type = cyberchimps_get_option( 'error_sidebar_options', 'right_sidebar' ); } else { $layout_type = apply_filters( 'cyberchimps_default_layout', 'right_sidebar' ); } cyberchimps_get_layout( $layout_type ); } add_action( 'wp', 'cyberchimps_create_layout' ); function cyberchimps_get_layout( $layout_type ) { $wide_sidebar = cyberchimps_get_option( 'wide_sidebar', 0 ); $layout_type = ( $layout_type ) ? $layout_type : 'right_sidebar'; $content_span = ( $wide_sidebar == 1 ) ? 'cyberchimps_class_span8' : 'cyberchimps_class_span9'; $sidebar_span = ( $wide_sidebar == 1 ) ? 'cyberchimps_class_span4' : 'cyberchimps_class_span3'; switch( $layout_type ) { case 'full_width' : add_filter( 'cyberchimps_content_class', 'cyberchimps_class_span12' ); break; case 'right_sidebar' : add_action( 'cyberchimps_after_content_container', 'cyberchimps_add_sidebar_right' ); add_filter( 'cyberchimps_content_class', $content_span ); add_filter( 'cyberchimps_content_class', 'cyberchimps_content_sbr_class' ); add_filter( 'cyberchimps_sidebar_right_class', $sidebar_span ); break; case 'left_sidebar' : add_action( 'cyberchimps_before_content_container', 'cyberchimps_add_sidebar_left' ); add_filter( 'cyberchimps_content_class', $content_span ); add_filter( 'cyberchimps_content_class', 'cyberchimps_content_sbl_class' ); add_filter( 'cyberchimps_sidebar_left_class', $sidebar_span ); break; case 'content_middle' : add_action( 'cyberchimps_before_content_container', 'cyberchimps_add_sidebar_left' ); add_action( 'cyberchimps_after_content_container', 'cyberchimps_add_sidebar_right' ); add_filter( 'cyberchimps_content_class', 'cyberchimps_class_span6' ); add_filter( 'cyberchimps_content_class', 'cyberchimps_content_sb2_class' ); add_filter( 'cyberchimps_sidebar_left_class', 'cyberchimps_class_span3' ); add_filter( 'cyberchimps_sidebar_right_class', 'cyberchimps_class_span3' ); break; case 'left_right_sidebar' : add_action( 'cyberchimps_after_content_container', 'cyberchimps_add_sidebar_left' ); add_action( 'cyberchimps_after_content_container', 'cyberchimps_add_sidebar_right' ); add_filter( 'cyberchimps_content_class', 'cyberchimps_class_span6' ); add_filter( 'cyberchimps_content_class', 'cyberchimps_content_sb2r_class' ); add_filter( 'cyberchimps_sidebar_left_class', 'cyberchimps_class_span3' ); add_filter( 'cyberchimps_sidebar_right_class', 'cyberchimps_class_span3' ); break; } } class cyberchimps_Walker extends Walker_Nav_Menu { function start_lvl( &$output, $depth = 0, $args = array() ) { //In a child UL, add the 'dropdown-menu' class if( $depth == 0 ) { $indent = str_repeat( "\t", $depth ); $output .= "\n$indent