• Resolved pingwin

    (@pingwin)


    Hey hey,

    I’m having a bit of trouble changing the logo url to something other than the standard wordpress URL of your site.

    Could anyone shine some light on where I need to be sniffing and changing some lines to allow a change to this logo to happen?

    Thanks in advance.

Viewing 1 replies (of 1 total)
  • What you would need to do is open your functions.php file and find the following code located on lines 492-513:

    /*Get logo img*/
    if (!function_exists('fruitful_get_logo')) {
    function fruitful_get_logo () {
    	$theme_options  = fruitful_ret_options("fruitful_theme_options");
    	$url_logo = '';
    
    	if (!empty($theme_options['logo_img'])) { $url_logo_id	= esc_attr($theme_options['logo_img']); } else { $url_logo_id 	= ''; }
    
    	/*Full Backend Options*/
    	$description  = $name = '';
    	$description  = esc_attr(get_bloginfo('description'));
    	$name  		  = esc_attr(get_bloginfo('name'));
    
    	if ($url_logo_id != "") {
    		$url_logo = wp_get_attachment_image_src($url_logo_id, 'full');
    		$url_logo = esc_url_raw($url_logo[0]);
    		echo  '<a href="' . esc_url( home_url( '/' ) ) . '" title="' . $description .'" rel="home"><img class="logo" src="'. $url_logo  .'" alt="' . $description . '"/></a>';
    	} else {
    		echo  '<a class="logo-description" href="' . esc_url( home_url( '/' ) ) . '" title="' . $description .'" rel="home"><h1 class="site-title">'. $name .'</h1><h2 class="site-description">'. $description .'</h2></a>';
    	}
    }
    }

    The bits you need to change are where it says esc_url( home_url( ‘/’ ) ) (2 instances above)

    You need to remove the inside brackets so you are left with this: esc_url( ” )

    Between them two accents you then need to add your URL

    Which will then leave you with the snippet of code below. Feel free to just copy the below and paste it over lines 492-513 of your functions.php file and change the 2 instances of the domain to whatever you want it to be (i have used google below):

    /*Get logo img*/
    if (!function_exists('fruitful_get_logo')) {
    function fruitful_get_logo () {
    	$theme_options  = fruitful_ret_options("fruitful_theme_options");
    	$url_logo = '';
    
    	if (!empty($theme_options['logo_img'])) { $url_logo_id	= esc_attr($theme_options['logo_img']); } else { $url_logo_id 	= ''; }
    
    	/*Full Backend Options*/
    	$description  = $name = '';
    	$description  = esc_attr(get_bloginfo('description'));
    	$name  		  = esc_attr(get_bloginfo('name'));
    
    	if ($url_logo_id != "") {
    		$url_logo = wp_get_attachment_image_src($url_logo_id, 'full');
    		$url_logo = esc_url_raw($url_logo[0]);
    		echo  '<a href="' . esc_url( 'https://www.google.com' ) . '" title="' . $description .'" rel="home"><img class="logo" src="'. $url_logo  .'" alt="' . $description . '"/></a>';
    	} else {
    		echo  '<a class="logo-description" href="' . esc_url( 'https://www.google.com' ) . '" title="' . $description .'" rel="home"><h1 class="site-title">'. $name .'</h1><h2 class="site-description">'. $description .'</h2></a>';
    	}
    }
    }

    Good luck

Viewing 1 replies (of 1 total)
  • The topic ‘Change logo url’ is closed to new replies.