You can use wp_is_mobile() to check whether it is a mobile device or desktop user.
<?php if ( wp_is_mobile() ) : ?>
/* Display and echo mobile specific stuff here */
<?php else : ?>
/* Display and echo desktop stuff here */
<?php endif; ?>
Related Posts:
- How can I modify what is being output in wp_head, whether by a theme or WordPress in general?
- How can I reduce the amount of files loaded/included per plugin?
- Do deactivated plugins slow down a WordPress site?
- Restricting a Plugin to Only Load its CSS and JS on Selected Pages?
- force enqueue script to be first in order of prominence
- How do I force wp_enqueue_scripts to load at the END of ?
- Change Page’s Tag Using functions.php File
- For performance is it better to build custom functionality into the theme or a plugin
- Multiple plugins vs combined one
- Add code into on a per page/post basis
- WordPress tips for speed and performance [closed]
- Do Plugins effect site loading time?
- How to load different css file for different pages
- append stylesheet via shortcode
- How to load plugin before the wordpress jquery?
- WordPress shortcodes & performance
- Changing BIGINT to INT
- Disable wordpress from including jQuery in the head section
- Prevent CSS/JS loading when plugin is not used
- How to see list of plugins
- Is it ok to call get_option without hooks?
- How to add inline css/js inside a shortcode
- WordPress web page struggling with performance
- How do I know which plugin uses the most resource?
- How can I measure the performance of any WordPress Plugin or Theme?
- add action wp_head not working
- adding meta data using plugin to top of head
- prettyPhoto media loading very slowly in Chrome
- How to load plugin after page is loaded – pagespeed issues
- WordPress takes too much time (100 seconds) to load – Front end and back end
- WordPress performance – W3 Total Cache and memcached/APCu
- Create mobile navigation header with settings integration
- how to find and correct plugin query performance issues
- Add javascript to wp_head with call to plugin options?
- Correct way to perform non-cacheable DB query
- What’s the best way to implement AJAX in WordPress?
- CSS from textarea in options page to frontend what to do
- Does using WP-cron make the site slower for the user?
- page loading time of a cached page
- Will Gutenberg Have a Negative Impact on Page Speed?
- How to get DEFER or ASYNC attribute to appear when I add a stylesheet with wp_enqueue_style from a plugin? [duplicate]
- wp_footer hook only working on homepage not in other pages
- w3 Total Cache not Caching – Requested URI is rejected [closed]
- Inject HTML meta tag inside wordpress tag using add_shortcode
- Improving the perfomance of a plugin action
- Namespaced shortcode?
- Disabling Wp_is_mobile from backend?
- Does heavy theme and plugins affect server’s response time? [closed]
- One sub site is slow while all others load fine, same theme & plugins [closed]
- How to load different homepage on Mobile.?
- What are the performance hiccups when building plugins?
- WordPress stats: OWA plugin overhead in the future
- Performance impact with inactive plugins? [duplicate]
- (WordPress 5.8.3) Function.php or a plugin for better performance? [duplicate]
- Adding Plugin Assets to Header
- Plugin has added weird data in wp_options, set to autoload
- Super slow plugin page (lots of error 500)
- wp_enqueue_style on template_redirect level?
- How to manipulate the content within wp_head
- How to accept images at multiple sizes and aspect ratios and display as standardized image size / ratio?
- Profile / benchmark wordpress on apache?
- Grab ID from post from plugin and use it to create an object
- Is wp_deregister_script the best way to deal with unneeded plugins in a page?
- Trying to use shortcode for a plugin on custom homepage of Responsive theme
- should i use GLOB_ONLYDIR to hook add-ons for wordpress plugin
- Minification Plugins break my website
- Button and Countdown overlapping mobile menu
- “Disable” specific plugins on certain pages
- How to remove Unused CSS From a WordPress Theme?
- Profiling the initial PHP file, anyone, that get like 10 seconds to load
- i create functions.php in plugin files but add_action (‘wp_head’, ‘function_name’) don’t work
- Loading a plugin in a post template without using wp_head()
- Shortcode function not showing up on mobile browser
- How do I override WordPress plugin css [closed]
- Update javascript URL in header – Domain Mapping Plugin [closed]
- Front End Page Not Loading Header Footer
- How can I disable Jetpack plugin on mobile?
- Searched & tried a lot: Is it Possible to Eliminate Render Blocking Manually
- API calls on plugin activation or init?
- Best use adding user generated JS/CSS to a theme with a plugin
- Is saving multiple options or saving multiple items in one option better?
- Very Slow loading. Plugins report provided by P3 included
- Plugins to generate CSS Sprites? [closed]
- Combining JS files to one script
- How to generate a responsive output from plugin?
- Eliminate Render blocking CSS?
- How to debug periodic performance issue
- Is option_active_plugins actually doing anything useful?
- Hidden Elementor sections slow down website. How to fix this? [closed]
- How can i store cache of wordpress a database request without plugins?
- How can I wordpress cache a database request with no existing plugin?
- When to store store plugin options as a single database record?
- How to resolve status code: 410 from Pagespeed insights for the wordpress website
- WordPress Website is very slow after migration
- The sidebar in wp-admin dashboard disappears when viewed on mobile screens in WordPress
- My WP site and password was hacked, what to do? [closed]
- save_post hook is not working after changing priority
- wordpress plugin | short code issue
- Place max_execution_time in plugin [closed]
- WordPress site keeps getting flagged as malware [closed]