Created
July 30, 2014 14:46
-
-
Save fovoc/53d4cb763b4d96787573 to your computer and use it in GitHub Desktop.
Shoestrap 3.2.6 - Remove default navbar_brand filter // Add new function in its place
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 | |
// Remove default navbar_brand filter | |
// Add new function in its place | |
add_action( 'init', 'add_sitename' ); | |
function add_sitename(){ | |
global $ss_menus; | |
remove_filter( 'shoestrap_navbar_brand', array( $ss_menus, 'navbar_brand' ) ); | |
add_filter( 'shoestrap_navbar_brand', 'my_navbar_brand' ); | |
} | |
function my_navbar_brand() { | |
global $ss_settings, $ss_framework; | |
$logo = $ss_settings['logo']; | |
$branding_class = ! empty( $logo['url'] ) ? 'logo' : 'text'; | |
if ( $ss_settings['navbar_brand'] != 0 ) { | |
$branding = '<a class="navbar-brand ' . $branding_class . '" href="' . home_url('/') . '">'; | |
$branding .= $ss_framework->logo(); | |
$branding .= '</a>'; | |
$branding .= get_bloginfo( 'name' ); | |
} else { | |
$branding = ''; | |
} | |
return $branding; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you!