[is_mobile]You are Using a Mobile Device[/is_mobile]
This shortcode allows you to display different content depending on whether the visitor is using a mobile device or a desktop computer.
Parameters
- default – (accepts: text) – Content to display if the visitor is not on a mobile device (optional)
- exclude – (accepts: comma-separated text) – Hides content for specific locations (continent, country, region, or city)
- include – (accepts: comma-separated text) – Displays content only for specific locations
- cache – (no value) – Enables AJAX-based caching. Automatically applied if cache setting is enabled
Return
Displays the inner content only if the user is on a mobile device. If not, the default
message is returned (if defined).
Examples
Display a custom message based on device type:
[is_mobile default="You are Using a Desktop Device"]You are Using a Mobile Device[/is_mobile]
Returns:
You are Using a Desktop Device