Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2014
    Location
    hamilton, ohio
    Posts
    100
    Plugin Contributions
    0

    Default How to replace logo on tablets/mobile on responsive template...

    Hello. I want to replace my websites logo with a different image on tablets/mobile. I can figure out how to hide it using this code:


    Code:
    @media (max-width: 730px) { 
    	#logo {display: none;}	
    }
    I am just wondering what I could do to replace the logo with a different image around that same pixel width. I have tried this no to no avail:

    Code:
    @media (max-width: 730px) { 
    	#logo {background-image: url("image url");}	
    }

  2. #2
    Join Date
    May 2009
    Posts
    1,219
    Plugin Contributions
    2

    Default Re: How to replace logo on tablets/mobile on responsive template...

    Have you tried removing the logo details from includes/languages/english/YOUR_TEMPLATE/header.php, and then put different backgrounds based on media?

  3. #3
    Join Date
    Jun 2008
    Location
    Osprey, Florida
    Posts
    151
    Plugin Contributions
    14

    Default Re: How to replace logo on tablets/mobile on responsive template...

    All you are doing with the css is adding a background to the logo. Like keneso says, you have to remove the logo in order for that css to work. If you want to remove it from mobile devices, I would suggest adding a copy of mobiledetect to your includes/functions/extra_functions folder, make a copy of includes/languages/english/header.php and add it to your current folder as in includes/languages/english/YOUR_CURRENT_THEME/header.php.

    Add this after line 9
    PHP Code:
    $detect = new Mobile_Detect
    Replace lines 23 to 25
    PHP Code:
      define('HEADER_LOGO_WIDTH''192px');
      
    define('HEADER_LOGO_HEIGHT''64px');
      
    define('HEADER_LOGO_IMAGE''logo.gif'); 
    with
    PHP Code:
    if ( $detect->isMobile() ) {
         
    define('HEADER_LOGO_WIDTH''?px');
         
    define('HEADER_LOGO_HEIGHT''?px');
         
    define('HEADER_LOGO_IMAGE''new_logo');
    } else {
         
    define('HEADER_LOGO_WIDTH''192px');
         
    define('HEADER_LOGO_HEIGHT''64px');
         
    define('HEADER_LOGO_IMAGE''logo.gif');

    Change new_logo and ?px with your new image and dimensions for it.

  4. #4
    Join Date
    Feb 2006
    Location
    UK
    Posts
    306
    Plugin Contributions
    1

    Default Re: How to replace logo on tablets/mobile on responsive template...

    Hi fantastic that you have created such a addon for the zencart product, it is superb, I will very shortly be making a donation.

    I don't know whether this is a problem for me only but the 'home' 'search' and shopping cart' buttons do not appear instead I get what looks like place holders for the options, could you offer a solution?

    Thanks again.

 

 

Similar Threads

  1. v155 Speed of V155 on mobile phone with responsive template
    By Quartier in forum Bug Reports
    Replies: 6
    Last Post: 4 May 2016, 03:29 PM
  2. v139h I bought a mobile template; how do I Mobile Device to Show Desktop version by Default
    By explorer1979 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 2 Mar 2013, 03:42 PM
  3. How do I replace image logo for live font logo ?
    By gabrielzn in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 15 Aug 2010, 07:00 AM
  4. How to replace store name with logo? Mystic Template
    By mamasylvia in forum Addon Templates
    Replies: 5
    Last Post: 28 Mar 2009, 03:41 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR