-
AuthorPosts
-
May 21, 2018 at 9:51 am #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.
May 21, 2018 at 9:39 pm #959992Hey sky19er,
You can change the wp_is_mobile
https://gist.github.com/sachyya/00cea68b13bc1ba5139cwith a custom functionality which will help you get it shorted out.
Best regards,
BasilisMay 22, 2018 at 9:00 am #960195Thanks, 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;
}May 23, 2018 at 4:46 pm #960944Hi sky19er,
Please check now, but on a mobile device, not in the browser emulator.
Best regards,
VictoriaMay 24, 2018 at 10:17 am #961401Thanks, 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.
May 25, 2018 at 2:01 pm #962121Hi sky19er,
Please check on the iPad again.
Best regards,
VictoriaMay 28, 2018 at 10:47 am #963041OK, 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.
May 30, 2018 at 11:23 am #964126Hi 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,
VictoriaMay 30, 2018 at 12:27 pm #964169OK, fair enough, thanks anyway.
June 1, 2018 at 10:13 am #965159Hi,
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,
RikardJune 1, 2018 at 3:16 pm #965405Thanks, you can close it.
June 2, 2018 at 11:40 am #965782 -
AuthorPosts
- The topic ‘enfold logo mobile left column layout’ is closed to new replies.