• Resolved vishnu18

    (@vishnu18)


    My homepage needs a different mobile logo than the rest of the webpages. Is this possible? When editing pages, there seems to be an option for using a different logo but it applies only to desktop.

    Also the Logo Max Height(px) under Customizing>>Header>>Mobile Menu doesn’t seem to be working.

    Thanks!

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter vishnu18

    (@vishnu18)

    I just found that tapping through the tablet & mobile icon in the Customizing>> Header >> Logo option allows me to set a max height for logo in respective devices. That’s even better! Thanks!

    Theme Author oceanwp

    (@oceanwp)

    Hello, glad that you find a solution ??

    Thread Starter vishnu18

    (@vishnu18)

    Actually my second issue was resolved, not the first.

    Is it possible to use a different mobile logo for just the homepage? OceanWP settings allows an option for a different desktop logo in each page but not a mobile one.

    Theme Author oceanwp

    (@oceanwp)

    Hello, try this code in the functions.php file of your child theme:

    function prefix_header_responsive_logo( $html ) {
    
    	if ( is_home() ) {
    
    		// Output image
    		$html = sprintf( '%5$s',
    			esc_url( home_url( '/' ) ),
    			'LOGO URL',
    			'150',
    			'50',
    			'Logo'
    		);
    
    	}
    
    	// Return logo
    	return $html;
    
    }
    add_filter( 'ocean_responsive_logo', 'prefix_header_responsive_logo' );

    Change “LOGO URL” by th e url of your logo, change “150” by the width of your logo, and “50” byt the height.

    Thread Starter vishnu18

    (@vishnu18)

    Not working for me.

    Is the code after “sprintf”

    <a href="%1$s" rel="nofollow"><img src="%2$s" width="%3$s" height="%4$s" alt="%5$s" /></a>?

    • This reply was modified 6 years, 4 months ago by vishnu18.
    Thread Starter vishnu18

    (@vishnu18)

    `<a href=”%1$s” rel=”nofollow”><img src=”%2$s” width=”%3$s” height=”%4$s” alt=”%5$s”></a>’

    Theme Author oceanwp

    (@oceanwp)

    Oh sorry, I didn’t see the code was not pasted correctly, here the good one:https://pastebin.com/9dQ5gZka

    Thread Starter vishnu18

    (@vishnu18)

    The code works except for it is not returning the new image src.

    The new img src I added was : https://www.onestopemail.com/wp-content/uploads/2018/02/ose-email-logo.jpg

    Please take a look here – onestopemail.com

    Theme Author oceanwp

    (@oceanwp)

    Hello, use this code: https://pastebin.com/XArvfhYt

    Thread Starter vishnu18

    (@vishnu18)

    That works awesome! Thank you very much!!

    Theme Author oceanwp

    (@oceanwp)

    You’re welcome ??

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Using a different mobile logo for each page’ is closed to new replies.