wp_is_mobile() this function is for code the device on which you viewing site is mobile. i mean this condition will true if you view site in mobile. now as per your question you want to display slider and sidebar only in desktop then your code will be like below:
1. for sidebar
if (!wp_is_mobile() ) {
get_sidebar();
}
2. for slider
if (!wp_is_mobile() ) {
// slider related stuffs.
}
Related Posts:
- How to detect mobile devices and present them a specific theme?
- Is wp_is_mobile() effective?
- What is the correct way to do a mobile theme for WordPress?
- Free starter theme to make mobile websites? [closed]
- How does a mobile WordPress theme differ from a simple theme?
- Divi – How can we show background video on mobile
- Issue with loading mobile specific custom single page layout in mobile
- How do I provide for multiple crops of the same image in a theme?
- Review site using WordPress
- Create theme for mobile phones and tablets only?
- How to hide custom sidebar on mobile
- Change Image Sizes for Mobile Theme
- Should I detect the device or the page first?
- Reliable method to detect mobiles
- Bootstrap 4 mobile menu not working for WordPress Development
- Making update notification functionality for my themes
- Should `get_template_directory_uri()` be escaped?
- Best practice for including plugins as part of a theme?
- How to disable 3.1 “Admin Bar” via script for the admin user?
- Where do I find the functions triggered within a hook?
- Is it possible to display the admin bar while in the Theme Customizer?
- two tinyMCE editors in the same page
- How to Change CSS Variable value in Theme Customizer Live Preview
- Pagination & get_pages?
- index.php is not loaded for single posts
- Easy WordPress theme creation tutorial? [closed]
- How do I add a post to a menu
- Append HTML to an LI of wp_list_categories
- Customizer API and add_panel(). Panel doesn’t show
- how to change a theme slug
- How display id of most recent modified post in wordpress?
- I want to get the home root path
- How to add code in the content area in a WordPress theme?
- Can I show all the template files that are being used on my site?
- How to make Home Menu( Front Page) use index.php instead of page.php
- Unable to pass variable on theme cusomizer add_settings()
- JavaScript Change focus to password field login page being reset
- Using esc_url with a hard coded url
- Broken template went invisible
- get_theme_mod returning no output
- Select full Image Size on widget “Genesis – Featured Posts”
- Where to find the code that redirects requests on the static page URL to the home page
- How to change database values on theme update
- after renaming my wp-content folder, how do I upgrade my wordpress version?
- Issue on Adding A Class to Bootstrap Navbar Walker Dropdown
- Post thumbnail to append post content via ajax click event
- Is it possible to save more than one image to an option?
- Theme’s window.open call goes to “Page Not Found”
- Custom WordPress File Inclusion
- Should i clear the plugin cache for cache busting?
- Wp Super Cache stops the update of a Post Meta
- Renaming a theme so it aids SEO and the theme used is hidden
- Dynamic menu links after header title
- Does the textdomain have to be the theme’s name?
- How to do a section of bulleted text within our page?
- What should I use? index.php, front-page.php and home.php
- Theme thumbnail in dashboard
- Prerequisites Skills to learn WordPress [closed]
- What is the diferences between pure WordPress theme and Woocommerce theme? [closed]
- How to rotate every letter in a title
- Should I create multiple sidebars, or use or one dynamic sidebar with logic to determine it’s abilities?
- Insert Rich Text Editor in theme?
- WordPress Theme that returns all posts as a JSON object?
- HTML block gutenberg templates
- Use a filter on menu items that have children
- Customizer: get_preview_url() inside customize_save_after hook
- How to add custom meta box when you have a custom page template file
- Password protect a custom template
- Reusable and site-wide content that can be used in a theme
- Theme Check errors of theme code
- New to WordPress – Read the Codex, Other Docs; Still Confused
- Style first 3 posts differently with WP_Query [duplicate]
- Post archives link yields a 404 Not Found
- is_front_page use in sidebar.php
- matisse theme show excerpts not whole content
- My custom taxonomies are not showing up in the admin menus
- Let user to upload multiple time
- get main URL from subdirectory with php
- How to add custom theme in hosting server?
- Infinite loop when nesting have_posts()
- WordPress Custom Theme : Theme Builder vs ACF vs Gutenberg
- Is_single not working properly in genesis
- Debugging slow WordPress Theme Customizer (Any option similar to Query Monitor)?
- register_theme_directory() sees custom themes directory, but blank frontend
- how to call options on front end and add logo
- Jetpack Infinite Scroll Not Working
- After WP 4.6.1 Update , Blog page started giving 500 error
- How to show children pages as array
- How do I keep images in posts below a certain size without editing the post?
- Theme options not displaying correctly after theme update
- Multiple Content Shortcodes
- Is it possible to customize the layout of Gallery Shortcode?
- How can i use archive.php for indexing wordpress default posts?
- Add the ability of changing background color of a theme [closed]
- How to use esc_attr__() function properly to translate a variable that contains string?
- What to do when child theme is out of date with parent theme
- How to make website with many template that active [closed]
- Query for tag given slug
- Image Size wrong during upload
- How can I add a single image from a gallery into the page header?