WordPress does have a helper function for detecting mobile devices, wp_is_mobile() (untested):
if ( ! wp_is_mobile() ) {
echo do_shortcode( '[meta_gallery_slider arrows="false" show_caption="false" show_title="false" autoplay="false" slider_height="450"]' );
}
As Jacob Peattie mentioned, this is unreliable. Better option is to use CSS to show the output only for viewport widths above specified value (untested):
PHP:
printf(
'<div class="hide-if-mobile">%s</div>',
do_shortcode( '[meta_gallery_slider arrows="false" show_caption="false" show_title="false" autoplay="false" slider_height="450"]' )
);
CSS:
@media ( max-width: 768px ) {
.hide-if-mobile { display: none; }
}
Related Posts:
- How can I stop WordPress from prompting me to enter FTP information when doing updates?
- Get the category from an ID of a product?
- dbDelta only creates the last table
- insert data in database table from plugin with WP3.1
- Using nextGen Gallery.. how can I call a list of all Gallery Names?
- Ship plugin with a custom theme
- Add code into on a per page/post basis
- Is there a way to display Woocommerce nav filter widget filters for shop page in all headers?
- WordPress widget / plugin….fields not appearing in my widget
- What is $tab in `install_plugins_{$tab}` hook?
- Use plugin function outside WordPress file
- Plugin form unable to process
- Meteor Slides as header only for homepage and Use featured image of each page as header for respective pages
- Plugin to install a plugin
- How do I use WordPress PHP functions in my Javascript code?
- Plugin is available to update when its not
- I need some direction on how to have a sidebar based on meta rather than page
- Using plugin functionality in external php script not working
- How can i add all videos from youtube playlist as post?
- Add Image to the RSS plugin reader from another RSS [closed]
- Improving a Stackoverflow “inspired” badge system to display badges in author page
- Is there a plugin to insert pre-defined link into editor?
- Override plugin with functions.php
- audio streaming plugin but with no save option?
- Missing argument 3 for wp_register_sidebar_widget()
- Pass variable to nested shortcode
- Simple plugin for showing RSS subscription links?
- How to make my plugin able to be updated from admin panel?
- WordPress Plugin Page is Loading in Admin Content Container Instead of Separate Page
- How to display sub categories under products page using woocommerce with mystile theme [closed]
- Is there a way I can find wordpress posts that don’t contain a word?
- Is Wrapping intval() Around esc_attr() Redundant for Escaping Input?
- Generate XML Sitemap for Blog on Magento Platform
- Display data on Word Press site posts and pages from mysql table
- How to save additional user data as part of the registration process?
- Why is output buffering used here?
- What’s the best way to implement AJAX in WordPress?
- Cannot find a list of data selectors for Gutenberg editor
- Trying to create a plugin to change wordpress site icons per page
- What is the correct way to show $href = vc_build_link( $href ); [closed]
- PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback Error without any function name
- Adapt PHP form action for WordPress?
- trying to get product category image in woo-coomerce
- How to export all content with feature images?
- this jQuery function works perfect in static html page but not on wordpress
- Sidebar widget: Randomly select text from a given set
- Run a plugin just ‘once’ per page reload
- redirected you too many times
- Create custom pages with a plugin
- Is it possible for a plugin to force reading and writing of uploaded images to a database instead of to a filesystem?
- $wpdb update query in plugin only updating one column
- WordPress as template engine
- Cropping images from top center using Jetpack Photon
- XML Sitemap Generator can’t notify google and bing
- How to limit image size for the entire website ? But without editing the post (css/plugin?!)
- Minimize and Uglify WordPress Plugin Files
- How do I make sure that my plugin only runs on article detail pages?
- Post deleted in trash [closed]
- Remove specific administrator’s capability
- Different Layerslider by page id?
- How to change Header image depending on language [closed]
- How do I show content from a plugin using the template the site is currently working with?
- Interface needed to transfer contents in a table on a web page to the Add New Product interface
- Advanced Custom Fields Plugin – Images not displaying
- Save log for imports in WordPress database – options-table, custom post type or other place?
- page duplication on wordpress that wont stop
- the_posts_pagination() not working if I add wp_head() to header.php
- Need help with Task assigning and rewarding as currency which withdrawable
- Hide content for specific users with id
- main navigation menu disappear after adding jquery source file
- Getting unknown text in footer of email
- Insert Sponsor logo in custom own theme
- Dynamical slug on custom post type
- Compare Ajax Data Results
- WordPress delete cookie
- Convert slugs on post publish
- WordPress Add advertising ads befor and after content with periority [closed]
- Upload image to wordpress using ionic/cordova with WP REST API V2
- Same Title on two different post type with single custom taxonomy
- Every time I use wp_get_current_user() my plugin breaks
- woocommerce blank page after clicking add to cart [closed]
- Working plugin code breaks admin
- wordpress option page data from select form is not saving to database
- How to use shortcode of any plugin to show it visually where i want?
- Custom User Role
- Plugin not installing properly, functions being redeclared
- WordPress automatic plugin update
- How to list posts that appear in two categories
- Woocommerce Bookings – Resource needs to be allocated for part of the booking duration, not the whole booking
- Load my plugin before cache
- How to get current template file used by WordPress?
- Is it possible to debug plugins with Xcode?
- Plugin link does not appear in my toolbar
- Supersize plugin error in internet explorer 7 and 8 [closed]
- Admin access to WordPress site with installing plugin
- Is there a method or plugin to download my products in WooCommerce?
- Add image before link in woocommerce plugin [closed]
- How to change data format in custom meta box field [closed]
- Why is my activator class adding the files/running the actions I add?
- Automatic assignment of multi images to products in WooCommerce/WordPress with SKU