Created
December 2, 2015 14:56
-
-
Save fovoc/fe776dfcc8aaf713afeb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Call child-theme style sheet instead of parent them style.css | |
function shoestrap_child_theme_stylesheet() { | |
wp_enqueue_style('shoestrap_child', get_stylesheet_uri(), false, null); | |
} | |
add_action('wp_enqueue_scripts', 'shoestrap_child_theme_stylesheet', 110); | |
//from favoc 11-14-14 is response to http://press.codes/forums/topic/fluid-navbar-in-a-wide-layout-flipping-jumbotron-and-secondary-navbar/ | |
function move_extra_header() { | |
global $ss_headers; | |
// remove the Extra Header | |
remove_action( 'shoestrap_pre_wrap', array( $ss_headers, 'branding' ), 3 ); | |
// add it before the primary navigation | |
add_action( 'shoestrap_pre_top_bar', array( $ss_headers, 'branding' ), 1 ); | |
} | |
add_action( 'init', 'move_extra_header' ); | |
//from same post – to flip secondary navbar BEFORE jumbotron | |
// function replace_secondary_menu() { | |
// global $ss_menus; | |
// // remove secondary navbar as added in /framework/bootstrap/includes/class-Shoestrap_Menus.php#L22 | |
// remove_action( 'shoestrap_pre_wrap', array( $ss_menus, 'secondary_navbar' ) ); | |
// // add our new navbar on top of Jumbotron area | |
// add_action( 'shoestrap_pre_wrap', array( $ss_menus, 'secondary_navbar' ), 1 ); | |
// } | |
// add_action( 'wp', 'replace_secondary_menu' ); | |
// [date] | |
function displaydate(){ | |
return date('l, F jS, Y'); | |
} | |
add_shortcode('date', 'displaydate'); | |
// end date | |
//Enable shortcodes in widgets | |
add_filter('widget_text', 'do_shortcode'); | |
// Add in Breadcrumb Trail | |
function my_custom_pre_main() { | |
if ( function_exists( 'breadcrumb_trail' ) ) breadcrumb_trail(); | |
} | |
add_action( 'shoestrap_pre_main', 'my_custom_pre_main' ); | |
//Add search form to secondary nav | |
add_action( 'shoestrap_pre_wrap', 'custom_secondary_navbar', 1 ); | |
function custom_secondary_navbar() { | |
global $ss_settings, $ss_framework, $ss_menus; | |
if ( has_nav_menu( 'secondary_navigation' ) ) : ?> | |
<?php echo $ss_framework->open_container( 'div' ); ?> | |
<header class="secondary navbar navbar-default <?php echo $ss_menus->navbar_class( 'secondary' ); ?>" role="banner"> | |
<button data-target=".nav-secondary" data-toggle="collapse" type="button" class="navbar-toggle"> | |
<span class="icon-bar"></span> | |
<span class="icon-bar"></span> | |
<span class="icon-bar"></span> | |
</button> | |
<?php | |
if ( $ss_settings['navbar_secondary_social'] != 0 ) { | |
SS_Framework_Bootstrap::navbar_social_links(); | |
} ?> | |
<nav class="nav-secondary navbar-collapse collapse" role="navigation"> | |
<?php do_action( 'custom_inside_secondary_nav_start' ); ?> | |
<?php wp_nav_menu( array( 'theme_location' => 'secondary_navigation', 'menu_class' => apply_filters( 'shoestrap_nav_class', 'navbar-nav nav' ) ) ); ?> | |
</nav> | |
</header> | |
<?php echo $ss_framework->close_container( 'div' ); ?> | |
<?php endif; | |
} | |
function custom_searchform_secondary_nav() { | |
global $ss_menus; | |
remove_action( 'shoestrap_pre_wrap', array( $ss_menus, 'secondary_navbar' ) ); | |
remove_action( 'shoestrap_inside_nav_begin', array( $ss_menus, 'navbar_pre_searchbox' ), 11 ); | |
add_action( 'custom_inside_secondary_nav_start', array( $ss_menus, 'navbar_pre_searchbox' ) ); | |
} | |
add_action('init','custom_searchform_secondary_nav'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment