Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #959602

    I’m using the Left Column Layout on a site (hidden from public; credentials in Private Content), and wanting to use a different logo for the mobile views which switch to a top/horizontal header. I found this solution for swapping out the logo — https://kriesi.at/documentation/enfold/logo/#use-a-different-logo-on-mobile — but this switches the logo on tablet/portrait views, where the header is still in the left column. Is there a way to modify the code so it only switches the logo when it needs to be switched (for the layouts that switch to a top/horizontal header (I guess only for phones)?

    Thanks and let me know if you have any questions.

    #959992

    Hey sky19er,

    You can change the wp_is_mobile
    https://gist.github.com/sachyya/00cea68b13bc1ba5139c

    with a custom functionality which will help you get it shorted out.

    Best regards,
    Basilis

    #960195

    Thanks, Basilis, but I’m sorry, I don’t actually “know” php, and I can’t seem to figure out how to use this code. So, now I have both snippets in there, as shown below. Do I need one of those “add_filter” or “add_action” lines for this new snippet to work?

    BTW, I added some css so that the only mobile version still using the Left Column Layout (and therefore still needing the default logo) is iPad Pro landscape (or anything above 1024px wide, so that’s all I need to target in terms of still using the default logo for mobile.

    So can you help me tweak this so the default logo is still used on mobile devices with a viewport wider than 1024px (like iPad Pro landscape)?

    Thanks and let me know if you have any other questions.

    `function custom_wp_is_mobile() {
    static $is_mobile;

    if ( isset($is_mobile) )
    return $is_mobile;

    if ( empty($_SERVER[‘HTTP_USER_AGENT’]) ) {
    $is_mobile = false;
    } elseif (
    strpos($_SERVER[‘HTTP_USER_AGENT’], ‘Android’) !== false
    || strpos($_SERVER[‘HTTP_USER_AGENT’], ‘Silk/’) !== false
    || strpos($_SERVER[‘HTTP_USER_AGENT’], ‘Kindle’) !== false
    || strpos($_SERVER[‘HTTP_USER_AGENT’], ‘BlackBerry’) !== false
    || strpos($_SERVER[‘HTTP_USER_AGENT’], ‘Opera Mini’) !== false ) {
    $is_mobile = true;
    } elseif (strpos($_SERVER[‘HTTP_USER_AGENT’], ‘Mobile’) !== false && strpos($_SERVER[‘HTTP_USER_AGENT’], ‘iPad’) == false) {
    $is_mobile = true;
    } elseif (strpos($_SERVER[‘HTTP_USER_AGENT’], ‘iPad’) !== false) {
    $is_mobile = false;
    } else {
    $is_mobile = false;
    }

    return $is_mobile;
    }

    add_filter(‘avf_logo’,’av_change_logo’);
    function av_change_logo($logo) {
    if(wp_is_mobile( ) )
    {
    $logo = “http://03601fe.netsolhost.com/wordpress1/wp-content/uploads/desert-tortoise-council-logo-horizontal.png”;
    }
    return $logo;
    }

    #960944

    Hi sky19er,

    Please check now, but on a mobile device, not in the browser emulator.

    Best regards,
    Victoria

    #961401

    Thanks, but I don’t have all the mobile devices needed to check on actual mobile devices. But I see a change in the Chrome Inspector Emulator — now it looks like the alternate logo is only being used up to max width 768 — I need it for set to max width 1024.

    Thanks again and let me know if you have any other questions.

    #962121

    Hi sky19er,

    Please check on the iPad again.

    Best regards,
    Victoria

    #963041

    OK, now it’s back to showing the alternate logo for all mobile views, including iPad Pro landscape (1366px wide), which is the only mobile layout I have using the desktop layout (left column layout). So, I’m still hoping to get the default logo to show in that iPad Pro landscape layout. One more try? ;)

    Thanks again and let me know if you have any other questions.

    #964126

    Hi sky19er,

    For that the function needs to be adjusted to check which iPad that is, but this is out of the scope of our support.

    Best regards,
    Victoria

    #964169

    OK, fair enough, thanks anyway.

    #965159

    Hi,

    Thanks for the feedback. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

    #965405

    Thanks, you can close it.

    #965782

    Hi,

    Thanks for the feedback. Please open a new thread if you should have any further questions or problems.

    Best regards,
    Rikard

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘enfold logo mobile left column layout’ is closed to new replies.