Hide If Mobilehide Content From Mobile Devices.



How To Display Or Hide Website Content On Mobile Devices? F you would like some website content to only show on mobile devices or not show on mobile devices, then following this post. You can do this using CSS. This allows a developer to easily control what sort of content should appear on mobile devices and what to display on desktops. When using a Spacer Element to separate content on a page, the spacer leaves a blank space on the mobile version as well. Adding the Spacer to the 'Hide if Mobile' Element will hide the Spacer when the page is viewed from a mobile device. Hi mate, at present there is no way to hide the navigation bar. But i have seen on devices with Lumia Denim update such as the Lumia 735, you are able to swipe away this navigation bar. Fingers crossed this comes to your device when the Lumia Denim update is released. Change your default launcher to hide app icons. If you’re unable to hide apps on your Android device, changing your launcher is a good workaround. If the term “launcher” doesn’t sound familiar, an Android launcher is the app that controls your Android device’s layout, the look of your Home screen, and your app drawer.

Mobile screen is small to display too much information. If you have a long WordPress post and do not want to display some part of the post on a mobile device, you can use a simple code to hide them. This code will only hide content on mobile without affecting the display on computers.

Hide WordPress content on mobile Phones

Here is the code you can use:

function not_mobile_shortcode($atts, $content = ') {
if (wp_is_mobile() true) {
$content = ';
}
return $content;
}
add_shortcode('not_mobile', 'not_mobile_shortcode');

You can copy and paste them into the function.php of your WordPress theme. Then when you are composing a new post or editing an existing WP content, use this tag to hide any content you do not want mobile users to view:

Hide If Mobile Hide Content From Mobile Devices. 19

[not_mobile]content invisible on mobile[/not_mobile]

Go to publish the post and view it with a web browser on your mobile device, you will not able to find the part nested in the not mobile section.

If you like to selectively hide content from particular devices, like mobile phones, tablet, desktop computers, iOS, Windows phone, Android, check out this guide to hide WordPress content using a plugin.

Posted in CSS Help, Email Resource by Justin On January 15, 2014. 29 Comments

This is a definitive guide into hiding content on desktop and web clients that you only want displayed on mobile email clients.

These days, responsive design is getting popular on email. Having the layout and sizes of elements change when viewed on a desktop vs mobile environment make for a much more pleasing email experience for the recipient.

The question is, what is the best way to hide content that you only want seen on a mobile device – such as a call to action to try out your mobile app or a clever layout trick – so that it is not displayed when the user opens on an email on a desktop or web client?

Ever considered adding interactivity into your email?
Try out the Image Carousel for Email Tool.

Hide Div On Mobile Devices

The proper way to hide content is to style a content with “display:none”, however due to the quirks on email clients such as Yahoo! Mail and Outlook 2007, 2010 and 2013 (Outlook 2007/10/13), its not as straightforward.

The markup below will do the trick:

2
<div class='mobilecontent'style='mso-hide:all;display:none;max-height:0px;overflow:hidden;'>
</div>

Warning: Make sure to put this on a div and not on a table. You can nest the table within the div if needed. This is because Yahoo! Mail will strip display:none and max-height cannot be applied to tables.

To show the content within mobile clients you add a media query:

2
CONTENT HIDDEN FROM OUTLOOK2007/10/13

In this case, the comment is saying if the version of MS Office is not 9, show the content, otherwise, hide it. A good resource is Campaign Monitor’s post Using Conditional Comments to Target Outlook 2007.

Displaying the Hidden Content on Mobile Clients

The vast majority of users on mobile (iPhone/Android) use the platform’s native email client and those clients support the media query example above and displays the content since the device width is below 480pixels (Should mobile clients start getting wider, that number may need to change).

Content may remain hidden on some mobile clients.

However, a small percentage of users use either the apps or mobile website version of Gmail, Outlook.com (Hotmail), and Yahoo! Mail. Unfortunately when viewing on these email clients, the content will remain hidden. This is because these clients either don’t support media queries or they strip embedded styles – both are a requirement to selectively display or hide content within an email based on the email client. See Email Client Media Query and Embedded Styles Support for the list of mobile email clients that support media queries.

Takeaway

  • Hiding content on web and desktop clients are harder than on mobile clients.
  • To hide an element with borders, wrap it with a div and apply the technique to the wrapping div to ensure the element including its borders are hidden in Gmail.
  • Hidden content may remain hidden on certain mobile clients which don’t support media queries

(Photo by c.mcbrien)