-
-
Save catchthemes/317bcc9b582168d8473d to your computer and use it in GitHub Desktop.
Removing link from Header Logo in Catch Mustang Theme. Just add the following code in your child theme functions.php file. After you add this, make sure you cahnge any value in Theme Options panel to clear your cache
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
/** | |
* Get the Header Image from theme options | |
* | |
* For header logo and site description. | |
* @uses default Header Logo if Header Logo field on theme options is empty | |
* @uses set_transient and delete_transient | |
*/ | |
function catchthemes_headerdetails() { | |
//delete_transient( 'catchthemes_headerdetails' ); | |
global $catchthemes_theme_options_settings; | |
$options = $catchthemes_theme_options_settings; | |
if ( ( !$catchthemes_headerdetails = get_transient( 'catchthemes_headerdetails' ) ) && ( empty( $options[ 'disable_logo_header'] ) || empty( $options[ 'remove_site_title' ] ) || empty( $options[ 'disable_header_description' ] ) ) ) { | |
echo '<!-- refreshing cache -->'; | |
$catchthemes_headerdetails = '<hgroup class="clearfix">'; | |
if( empty( $options[ 'disable_logo_header' ] ) ) { | |
$catchthemes_header_logo = '<h1 id="site-logo">'; | |
if ( !empty( $options[ 'featured_logo_header' ] ) ): | |
$catchthemes_header_logo .= '<img src="'.esc_url( $options['featured_logo_header'] ).'" alt="'.get_bloginfo( 'name' ).'" />'; | |
else: | |
// if empty featured_logo_header on theme options, display default logo | |
$catchthemes_header_logo .='<img src="'. get_template_directory_uri().'/images/logo.png" alt="logo" />'; | |
endif; | |
$catchthemes_header_logo .= '</h1>'; | |
} | |
else { | |
$catchthemes_header_logo = ''; | |
} | |
if ( empty( $options[ 'disable_header_title' ] ) || empty( $options[ 'disable_header_description' ] ) ) { | |
$catchthemes_site_details = '<div id="site-details">'; | |
if( empty( $options[ 'disable_header_title' ] ) ) { | |
$catchthemes_site_details .= '<h1 id="site-title"><a href="'.esc_url( home_url( '/' ) ).'" title="'.esc_attr( get_bloginfo( 'name', 'display' ) ).'">'.esc_attr( get_bloginfo( 'name', 'display' ) ).'</a></h1>'; | |
} | |
if( empty( $options[ 'disable_header_description' ] ) ) { | |
$catchthemes_site_details .= '<h2 id="site-description">'.esc_attr( get_bloginfo( 'description' ) ).'</h2>'; | |
} | |
$catchthemes_site_details .= '</div>'; | |
} | |
else { | |
$catchthemes_site_details = ''; | |
} | |
if ( empty( $options[ 'site_title_above'] ) ) { | |
$catchthemes_headerdetails .= $catchthemes_header_logo . $catchthemes_site_details; | |
} | |
else { | |
$catchthemes_headerdetails .= $catchthemes_site_details . $catchthemes_header_logo; | |
} | |
$catchthemes_headerdetails .= '</hgroup>'; | |
set_transient( 'catchthemes_headerdetails', $catchthemes_headerdetails, 86940 ); | |
} | |
echo $catchthemes_headerdetails; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment