/** * This function is for displaying the "Primary Navigation" bar. */ function calibrefx_do_nav() { global $calibrefx; /** Do nothing if menu not supported */ if (!calibrefx_nav_menu_supported('primary')) { return; } $calibrefx->load->library('walker_nav_menu'); $nav = ''; $args = ''; $superfish_class = apply_filters('nav_superfish', ' superfish'); if (calibrefx_get_option('nav')) { if (has_nav_menu('primary')) { $args = array('theme_location' => 'primary', 'container' => '', 'menu_class' => 'nav navbar-nav menu-primary menu' . $superfish_class, 'echo' => 0, 'walker' => $calibrefx->walker_nav_menu); $nav = wp_nav_menu($args); } else { $nav = '<ul id="menu-primary-i" class="nav navbar-nav menu-primary menu' . $superfish_class . '"> <li id="menu-item-812" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-800 current_page_item menu-item-812"><a href="#"><i class="fa fa-home"></i> Homepage</a></li> <li id="menu-item-813" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-813"><a href="#"><i class="fa fa-comment"></i> About Us</a></li> <li id="menu-item-817" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-817"><a href="#"><i class="fa fa-envelope-o"></i> Contact Page</a></li> </ul>'; } $nav_class = apply_filters('nav_class', calibrefx_row_class()); if (calibrefx_is_responsive_enabled()) { $nav_output = sprintf(' <div id="nav" class="navbar navbar-default"> %2$s <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="navbar-brand">%4$s</span> <span class="menu-toggle-icon"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </span> </button> </div> <div class="collapse navbar-collapse" role="navigation">%1$s</div> %3$s </div> <!-- end #nav -->', $nav, calibrefx_put_wrapper('nav', 'open', false), calibrefx_put_wrapper('nav', 'close', false), __('MENU', 'calibrefx')); } else { $nav_output = sprintf(' <div id="nav" class="navbar navbar-default"> %2$s %1$s %3$s </div> <!-- end #nav -->', $nav, calibrefx_put_wrapper('nav', 'open', false), calibrefx_put_wrapper('nav', 'close', false)); } echo apply_filters('calibrefx_do_nav', $nav_output, $nav, $args); } }
/** * This function/filter adds new classes to the <body> * so that we can use psuedo-variables in our CSS file, * which helps us achieve multiple header layouts with minimal code * * @since 0.2.2 */ function calibrefx_header_body_classes($classes) { // add header classes to $classes array if (!is_active_sidebar('header-right')) { $classes[] = 'header-full-width'; } if (current_theme_supports('calibrefx-custom-header') && ('image' == calibrefx_get_option('blog_title') || 'blank' == get_header_textcolor())) { $classes[] = 'header-image'; } if (calibrefx_is_responsive_enabled()) { $classes[] = 'responsive'; } else { $classes[] = 'non-responsive'; } if (calibrefx_layout_is_fluid()) { $classes[] = 'fluid'; } else { $classes[] = 'static'; } $custom_body = calibrefx_get_custom_field('_calibrefx_custom_body_class'); if (!empty($custom_body)) { $classes[] = $custom_body; } // return filtered $classes return $classes; }
function disable_responsive() { if (calibrefx_is_responsive_enabled()) { return; } ?> <style type="text/css"> /* Non-responsive overrides * * Utilitze the following CSS to disable the responsive-ness of the container, * grid system, and navbar. */ /* Reset the container */ body.non-responsive, body.non-responsive .container { width: <?php echo calibrefx_get_option('calibrefx_layout_width'); ?> px !important; max-width: none !important; } </style> <?php }
function col_offset_class() { $numargs = func_num_args(); if (1 == $numargs and is_array(func_get_arg(0))) { $opts = func_get_arg(0); $numopt = count(func_get_arg(0)); if (4 == $numopt) { $opt0 = $opts[0]; $opt1 = $opts[1]; $opt2 = $opts[2]; $opt3 = $opts[3]; } elseif (3 == $numopt) { $opt0 = $opts[0]; $opt1 = $opts[1]; $opt2 = $opts[2]; $opt3 = $opts[2]; } elseif (2 == $numopt) { $opt0 = $opts[0]; $opt1 = $opts[0]; $opt2 = $opts[1]; $opt3 = $opts[1]; } elseif (1 == $numopt) { $opt0 = $opts[0]; $opt1 = $opts[0]; $opt2 = $opts[0]; $opt3 = $opts[0]; } } else { $numopt = $numargs; if (4 == $numopt) { $opt0 = func_get_arg(0); $opt1 = func_get_arg(1); $opt2 = func_get_arg(2); $opt3 = func_get_arg(3); } elseif (3 == $numopt) { $opt0 = func_get_arg(0); $opt1 = func_get_arg(1); $opt2 = func_get_arg(2); $opt3 = func_get_arg(2); } elseif (2 == $numopt) { $opt0 = func_get_arg(0); $opt1 = func_get_arg(0); $opt2 = func_get_arg(1); $opt3 = func_get_arg(1); } elseif (1 == $numopt) { $opt0 = func_get_arg(0); $opt1 = func_get_arg(0); $opt2 = func_get_arg(0); $opt3 = func_get_arg(0); } } if (calibrefx_is_responsive_enabled()) { return 'col-xs-offset-' . $opt0 . ' col-sm-offset-' . $opt1 . ' col-md-offset-' . $opt2 . ' col-lg-offset-' . $opt3; } else { return 'col-xs-offset-' . $opt3; } return false; }
> <!--<![endif]--> <head> <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?> ; charset=<?php bloginfo('charset'); ?> " /> <link rel="profile" href="http://gmpg.org/xfn/11"> <?php if ('open' == get_option('default_ping_status')) { echo '<link rel="pingback" href="' . esc_url(get_bloginfo('pingback_url')) . '" />' . "\n"; } if (calibrefx_is_responsive_enabled()) { $width = "device-width"; } else { $width = calibrefx_get_option('calibrefx_layout_width'); } echo '<meta name="viewport" content="width=' . $width . ', initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />' . "\n"; do_action('calibrefx_meta'); wp_head(); ?> </head> <body <?php body_onload(); ?> <?php body_class(); ?>