Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #231077

    How can I do this?

    Thanks

    Jonny

    http://www.jonnyfreesh.com

    #231146

    Hey deyowulf!

    Can you please post a screenshot of what you’re trying to do? You can select the logo size before you click the “Insert image as logo” or use css to constrain the width and height.

    Best regards,
    Ismael

    #231161

    Hi Ismael,

    I picked full size when I inserted the image as my logo. When testing with GTMetrix it states that it is missing width and height attributes :

    https://www.dropbox.com/s/dlk3isxvl004m1a/Screenshot%202014-03-02%2009.08.27.png

    So I guess I need to insert the width and height attributes code somewhere, but I’m not sure exactly where to do this.

    #231632

    Hi!

    Please go to wp-content\themes\enfold\framework\php folder and open function-set-avia-frontend.php file and find

    src='{$logo}' alt='{$alt}' />";

    and change it to

    src='{$logo}' alt='{$alt}' width='900' height='100' />";

    and adjust as needed

    Best regards,
    Yigit

    #232021

    Can I create a new function-set-avia-frontend.php in my child theme and to the change like that or do I need to edit the original file?

    #232044

    Hi!

    You can copy the whole function code on your child theme’s function.php. I think YIgit is referring to the avia_logo function:

    if(!function_exists('avia_logo'))
    {
    	/**
    	 * return the logo of the theme. if a logo was uploaded and set at the backend options panel display it
    	 * otherwise display the logo file linked in the css file for the .bg-logo class
    	 * @return string the logo + url
    	 */
    	function avia_logo($use_image = "", $sub = "", $headline_type = "h1")
    	{
    		$use_image 		= apply_filters('avf_logo', $use_image);
    		$headline_type 	= apply_filters('avf_logo_headline', $headline_type);
    		$sub 			= apply_filters('avf_logo_subtext',  $sub);
    		$alt 			= apply_filters('avf_logo_alt', get_bloginfo('name'));
    		$link 			= apply_filters('avf_logo_link', home_url('/'));
    		
    		if($sub) $sub = "<span class='subtext'>$sub</span>";
    
    		if($logo = avia_get_option('logo'))
    		{
    			 $logo = "<img src='{$logo}' alt='{$alt}' />";
    			 $logo = "<$headline_type class='logo'><a href='".$link."'>".$logo."$sub</a></$headline_type>";
    		}
    		else
    		{
    			$logo = get_bloginfo('name');
    			if($use_image) $logo = "<img src='{$use_image}' alt='{$alt}' title='{$logo}'/>";
    			$logo = "<$headline_type class='logo bg-logo'><a href='".$link."'>".$logo."$sub</a></$headline_type>";
    		}
    
    		return $logo;
    	}
    }

    Regards,
    Ismael

    #232096

    Thanks that worked Ismael :)

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Specify Logo Image Dimensions’ is closed to new replies.