Skip to content

Instantly share code, notes, and snippets.

@fovoc
Created July 30, 2014 14:46
Show Gist options
  • Save fovoc/53d4cb763b4d96787573 to your computer and use it in GitHub Desktop.
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
<?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;
}
@niknaz
Copy link

niknaz commented Aug 9, 2014

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment