'; $output .= '

' . esc_html( get_bloginfo( 'name' ) ) . '

'; $output .= '

' . esc_html( get_bloginfo( 'description' ) ) . '

'; $output .= ''; } // Output logo is set if ( ! empty( $output ) ) { return $output; } } /* ---------------------------------------------------------------------------------- Page Layout ---------------------------------------------------------------------------------- */ /* Add Custom Sidebar css */ function bolder_thinkup_sidebar_css() { // Get theme options values. $thinkup_homepage_layout = bolder_thinkup_var ( 'thinkup_homepage_layout' ); $thinkup_general_layout = bolder_thinkup_var ( 'thinkup_general_layout' ); $thinkup_blog_layout = bolder_thinkup_var ( 'thinkup_blog_layout' ); $thinkup_post_layout = bolder_thinkup_var ( 'thinkup_post_layout' ); $thinkup_portfolio_layout = bolder_thinkup_var ( 'thinkup_portfolio_layout' ); $thinkup_project_layout = bolder_thinkup_var ( 'thinkup_project_layout' ); $thinkup_woocommerce_layout = bolder_thinkup_var ( 'thinkup_woocommerce_layout' ); $thinkup_woocommerce_layoutproduct = bolder_thinkup_var ( 'thinkup_woocommerce_layoutproduct' ); if ( is_front_page() ) { if ( $thinkup_homepage_layout == "option1" or empty( $thinkup_homepage_layout ) ) { echo ''; } else if ( $thinkup_homepage_layout == "option2" ) { wp_enqueue_style ( 'bolder-thinkup-sidebarleft' ); } else if ( $thinkup_homepage_layout == "option3" ) { wp_enqueue_style ( 'bolder-thinkup-sidebarright' ); } } else if ( is_page() ) { if ( $thinkup_general_layout == "option1" or empty( $thinkup_general_layout ) ) { echo ''; } else if ( $thinkup_general_layout == "option2" ) { wp_enqueue_style ( 'bolder-thinkup-sidebarleft' ); } else if ( $thinkup_general_layout == "option3" ) { wp_enqueue_style ( 'bolder-thinkup-sidebarright' ); } } else if ( bolder_thinkup_check_isblog() and ! is_single() ) { if ( $thinkup_blog_layout == "option1" or empty( $thinkup_blog_layout ) ) { echo ''; } else if ( $thinkup_blog_layout == "option2" ) { wp_enqueue_style ( 'bolder-thinkup-sidebarleft' ); } else if ( $thinkup_blog_layout == "option3" ) { wp_enqueue_style ( 'bolder-thinkup-sidebarright' ); } } else if ( is_singular( 'post' ) ) { if ( $thinkup_post_layout == "option1" or empty( $thinkup_post_layout ) ) { echo ''; } else if ( $thinkup_post_layout == "option2" ) { wp_enqueue_style ( 'bolder-thinkup-sidebarleft' ); } else if ( $thinkup_post_layout == "option3" ) { wp_enqueue_style ( 'bolder-thinkup-sidebarright' ); } else { echo ''; } } else if ( is_search() ) { if ( $thinkup_general_layout == "option1" or empty( $thinkup_general_layout ) ) { echo ''; } else if ( $thinkup_general_layout == "option2" ) { wp_enqueue_style ( 'bolder-thinkup-sidebarleft' ); } else if ($thinkup_general_layout == "option3") { wp_enqueue_style ( 'bolder-thinkup-sidebarright' ); } } } add_action( 'wp_enqueue_scripts', 'bolder_thinkup_sidebar_css', '11' ); /* Add Custom Sidebar html */ function bolder_thinkup_sidebar_html() { // Get theme options values. $thinkup_homepage_layout = bolder_thinkup_var ( 'thinkup_homepage_layout' ); $thinkup_general_layout = bolder_thinkup_var ( 'thinkup_general_layout' ); $thinkup_blog_layout = bolder_thinkup_var ( 'thinkup_blog_layout' ); $thinkup_post_layout = bolder_thinkup_var ( 'thinkup_post_layout' ); $thinkup_portfolio_layout = bolder_thinkup_var ( 'thinkup_portfolio_layout' ); $thinkup_project_layout = bolder_thinkup_var ( 'thinkup_project_layout' ); $thinkup_woocommerce_layout = bolder_thinkup_var ( 'thinkup_woocommerce_layout' ); $thinkup_woocommerce_layoutproduct = bolder_thinkup_var ( 'thinkup_woocommerce_layoutproduct' ); do_action('bolder_thinkup_sidebar_html'); if ( is_front_page() ) { if ( $thinkup_homepage_layout == "option1" or empty( $thinkup_homepage_layout ) ) { echo ''; } else if ( $thinkup_homepage_layout == "option2" ) { echo get_sidebar(); } else if ( $thinkup_homepage_layout == "option3" ) { echo get_sidebar(); } } else if ( is_page() ) { if ( $thinkup_general_layout == "option1" or empty( $thinkup_general_layout ) ) { echo ''; } else if ( $thinkup_general_layout == "option2" ) { echo get_sidebar(); } else if ( $thinkup_general_layout == "option3" ) { echo get_sidebar(); } } else if ( bolder_thinkup_check_isblog() and ! is_single() ) { if ( $thinkup_blog_layout == "option1" or empty( $thinkup_blog_layout ) ) { echo ''; } else if ( $thinkup_blog_layout == "option2" ) { echo get_sidebar(); } else if ( $thinkup_blog_layout == "option3" ) { echo get_sidebar(); } } else if ( is_singular( 'post' ) ) { if ( $thinkup_post_layout == "option1" or empty( $thinkup_post_layout ) ) { echo ''; } else if ( $thinkup_post_layout == "option2" ) { echo get_sidebar(); } else if ( $thinkup_post_layout == "option3" ) { echo get_sidebar(); } else { echo ''; } } else if ( is_search() ) { if ( $thinkup_general_layout == 'option1' or empty( $thinkup_general_layout ) ) { echo ''; } else if ( $thinkup_general_layout == "option2" ) { get_sidebar(); } else if ( $thinkup_general_layout == "option3" ) { get_sidebar(); } } } /* ---------------------------------------------------------------------------------- Select a Sidebar ---------------------------------------------------------------------------------- */ /* Add Selected Sidebar To Specific Pages */ function bolder_thinkup_input_sidebars() { // Get theme options values. $thinkup_general_sidebars = bolder_thinkup_var ( 'thinkup_general_sidebars' ); $thinkup_homepage_sidebars = bolder_thinkup_var ( 'thinkup_homepage_sidebars' ); $thinkup_blog_sidebars = bolder_thinkup_var ( 'thinkup_blog_sidebars' ); $thinkup_post_sidebars = bolder_thinkup_var ( 'thinkup_post_sidebars' ); $thinkup_portfolio_sidebars = bolder_thinkup_var ( 'thinkup_portfolio_sidebars' ); $thinkup_project_sidebars = bolder_thinkup_var ( 'thinkup_project_sidebars' ); $thinkup_woocommerce_sidebars = bolder_thinkup_var ( 'thinkup_woocommerce_sidebars' ); $thinkup_woocommerce_sidebarsproduct = bolder_thinkup_var ( 'thinkup_woocommerce_sidebarsproduct' ); if ( is_front_page() ) { $output = $thinkup_homepage_sidebars; } else if ( is_page() ) { $output = $thinkup_general_sidebars; } else if ( bolder_thinkup_check_isblog() and ! is_single() ) { $output = $thinkup_blog_sidebars; } else if ( is_singular( 'post' ) ) { $output = $thinkup_post_sidebars; } else if ( is_search() ) { $output = $thinkup_general_sidebars; } if ( empty( $output ) or $output == 'Select a sidebar:' ) { $output = 'Sidebar'; } return $output; } /* ---------------------------------------------------------------------------------- Intro Default options ---------------------------------------------------------------------------------- */ /* Add custom intro section [Extend for more options in future update] */ function bolder_thinkup_custom_intro() { // Get theme options values. $thinkup_general_breadcrumbswitch = bolder_thinkup_var ( 'thinkup_general_breadcrumbswitch' ); $class_intro = NULL; if ( ! is_front_page() ) { // Determine if breadcrumb is enables. Ensures table-cells align correctly with css if ( $thinkup_general_breadcrumbswitch == '1' ) { $class_intro = 'option2'; } // If no breadcrumbs are available on current page then change intro class to option1 if ( bolder_thinkup_input_breadcrumbswitch() == '' ) { $class_intro = 'option1'; } // Output intro with breadcrumbs if set echo '
', '

', bolder_thinkup_title_select(), '

', bolder_thinkup_input_breadcrumbswitch(), '
'; } } function bolder_thinkup_custom_introbackground() { // Get theme options values. $thinkup_general_introbackgroundcolor = bolder_thinkup_var ( 'thinkup_general_introbackgroundcolor' ); $output = NULL; if ( ! empty( $thinkup_general_introbackgroundcolor ) ) { $output .= '#intro {'; $output .= 'background: ' . esc_html( $thinkup_general_introbackgroundcolor ) . ';'; $output .= '}'; } if( ! empty( $output ) ) { echo ''; } } add_action( 'wp_head','bolder_thinkup_custom_introbackground', '12' ); /* Add custom intro class - Determine whether intro is enabled or disabled */ function bolder_thinkup_custom_introclass($classes) { if ( ! is_front_page() ) { $classes[] = 'intro-on'; } return $classes; } add_action( 'body_class', 'bolder_thinkup_custom_introclass'); /* ---------------------------------------------------------------------------------- Enable Breadcrumbs ---------------------------------------------------------------------------------- */ /* Toggle Breadcrumbs */ function bolder_thinkup_input_breadcrumbswitch() { // Get theme options values. $thinkup_general_breadcrumbswitch = bolder_thinkup_var ( 'thinkup_general_breadcrumbswitch' ); if( ! is_front_page() ) { if ( $thinkup_general_breadcrumbswitch == '0' or empty( $thinkup_general_breadcrumbswitch ) ) { return ''; } else if ( $thinkup_general_breadcrumbswitch == '1' ) { return bolder_thinkup_input_breadcrumb(); } } } /* ---------------------------------------------------------------------------------- Enable Responsive Layout ---------------------------------------------------------------------------------- */ /* http://wordpress.stackexchange.com/questions/27497/how-to-use-wp-nav-menu-to-create-a-select-menu-dropdown */ class bolder_thinkup_nav_menu_responsive extends Walker_Nav_Menu{ function start_el(&$output, $item, $depth=0, $args=array(), $id = 0) { global $wp_query; $indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; $class_names = $value = ''; $classes = empty( $item->classes ) ? array() : (array) $item->classes; $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) ); $class_names = ' class="' . esc_attr( $class_names ) . '"'; $output .= $indent . '
  • '; $attributes = ! empty( $item->attr_title ) ? ' title="' . esc_attr( $item->attr_title ) . '"' : ''; $attributes .= ! empty( $item->target ) ? ' target="' . esc_attr( $item->target ) . '"' : ''; $attributes .= ! empty( $item->xfn ) ? ' rel="' . esc_attr( $item->xfn ) . '"' : ''; $attributes .= ! empty( $item->url ) ? ' href="' . esc_url( $item->url ) . '"' : ''; // Insert title for top level $title = ( $depth == 0 ) ? '' . apply_filters( 'the_title', $item->title, $item->ID ) . '' : apply_filters( 'the_title', $item->title, $item->ID ); // Insert sub-menu titles if ( $depth > 0 ) { $title = str_repeat('- ', $depth ) . esc_html( $item->title ); } // Structure of output $item_output = $args->before; $item_output .= ''; $item_output .= $args->link_before . $title . $args->link_after; $item_output .= ''; $item_output .= $args->after; $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args ); } } // Fallback responsive menu when custom header menu has not been set. function bolder_thinkup_input_responsivefall() { $output = wp_list_pages('echo=0&title_li='); echo ''; } function bolder_thinkup_input_responsivehtml1() { // Get theme options values. $thinkup_general_fixedlayoutswitch = bolder_thinkup_var ( 'thinkup_general_fixedlayoutswitch' ); if ( $thinkup_general_fixedlayoutswitch !== '1' ) { echo ''; } } function bolder_thinkup_input_responsivehtml2() { // Get theme options values. $thinkup_general_fixedlayoutswitch = bolder_thinkup_var ( 'thinkup_general_fixedlayoutswitch' ); if ( $thinkup_general_fixedlayoutswitch !== '1' ) { $args = array( 'container_class' => 'responsive-links nav-collapse collapse', 'container_id' => 'header-responsive-inner', 'menu_class' => '', 'theme_location' => 'header_menu', 'walker' => new bolder_thinkup_nav_menu_responsive(), 'fallback_cb' => 'bolder_thinkup_input_responsivefall', ); echo '
    ', wp_nav_menu( $args ), '
    '; } } function bolder_thinkup_input_responsivecss() { // Get theme options values. $thinkup_general_fixedlayoutswitch = bolder_thinkup_var ( 'thinkup_general_fixedlayoutswitch' ); if ( $thinkup_general_fixedlayoutswitch !== '1' ) { wp_enqueue_style ( 'bolder-thinkup-responsive' ); } } add_action( 'wp_enqueue_scripts', 'bolder_thinkup_input_responsivecss', '12' ); function bolder_thinkup_input_responsiveclass($classes){ // Get theme options values. $thinkup_general_fixedlayoutswitch = bolder_thinkup_var ( 'thinkup_general_fixedlayoutswitch' ); if ( $thinkup_general_fixedlayoutswitch == '1' ) { $classes[] = 'layout-fixed'; } else { $classes[] = 'layout-responsive'; } return $classes; } add_action( 'body_class', 'bolder_thinkup_input_responsiveclass'); ?>