Skip to content

Commit

Permalink
Merge pull request #609 from rchq/master
Browse files Browse the repository at this point in the history
Branding URL HTTPS
  • Loading branch information
fovoc committed Jan 21, 2015
2 parents 31f1c33 + 343b700 commit 3891bcc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions framework/bootstrap/includes/class-Shoestrap_Branding.php
Expand Up @@ -48,11 +48,12 @@ function icons() {
public static function logo() {
global $ss_settings;
$logo = $ss_settings['logo'];

$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https:" : "http:";
$logo['url'] = $protocol. str_replace(array('http:', 'https:'), '', $logo['url']);


if ( ! empty( $logo['url'] ) ) {
//added to aid with SSL
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https:" : "http:";
$logo['url'] = $protocol. str_replace(array('http:', 'https:'), '', $logo['url']);

$branding = '<img id="site-logo" src="' . $logo['url'] . '" alt="' . get_bloginfo( 'name' ) . '">';
} else {
$branding = '<span class="sitename">' . get_bloginfo( 'name' ) . '</span>';
Expand Down
6 changes: 3 additions & 3 deletions framework/bootstrap/includes/class-Shoestrap_Menus.php
Expand Up @@ -182,21 +182,21 @@ function navbar_css() {
* and then add the appropriate logo or sitename.
*/
function navbar_brand() {
global $ss_settings, $ss_framework;
global $ss_settings;

$logo = $ss_settings['logo'];
$branding_class = ! empty( $logo['url'] ) ? 'logo' : 'text';
$branding = '';

if ( $ss_settings['navbar_brand'] === 'on' ) {
$branding = '<a class="navbar-brand ' . $branding_class . '" href="' . home_url('/') . '">';
$branding .= $ss_settings['navbar_logo'] == 1 ? $ss_framework->logo() : get_bloginfo( 'name' );
$branding .= $ss_settings['navbar_logo'] == 1 ? Shoestrap_Branding::logo() : get_bloginfo( 'name' );
$branding .= '</a>';
} elseif ( $ss_settings['navbar_brand'] === 'off' ){
$branding = '';
} elseif ( $ss_settings['navbar_brand'] === 'both' ){
$branding = '<a class="navbar-brand ' . $branding_class . '" href="' . home_url('/') . '">';
$branding .= $ss_framework->logo();
$branding .= Shoestrap_Branding::logo();
$branding .= '</a>';
$branding .= '<span class="navbar-sitename">' .get_bloginfo( 'name' ) .'</span>';
}
Expand Down

0 comments on commit 3891bcc

Please sign in to comment.