A few practical ways to hide the WordPress sidebar on mobile

Sidebars on computers are often used to place content such as searches, categories, advertisements or recommended articles, but on cell phones, these areas often crowd the main content space, affecting the reading experience. In order to make mobile access smoother, many webmasters will choose to hide the sidebar on the phone. This article will introduce several common methods to hide it on mobile devices without affecting the display on the computer terminal WordPress SidebarIt is easy to operate and does not require complex settings.

Image [1] - Practical ways to hide WordPress sidebar on mobile

I. Why hide the mobile sidebar?

  • Improve reading fluency: Smaller cell phone screens and sidebars tend to crowd the page
  • Faster loading: Avoid loading unnecessary components
  • Reduce bounce rate: Mobile users are more focused on the main content, removing distractions makes it easier to retain visitors
  • Enhancing the user experience: Avoid accidentally touching small icons, links and other small elements

II. Using CSS media queries to hide the sidebar

This is the easiest way toNo plug-ins, no impact SEO, suitable for most subjects.

Sample code:

@media (max-width: 768px) {
  .sidebar,
  #secondary {
    display: none;
  }
}

Usage:

  • Log in to the WordPress backend to go to theAppearance → Customize "
Image [2] - A Practical Way to Hide WordPress Sidebar on Mobile
  • Find the extra CSS, paste the code above and save it.
Image [3] - A Practical Way to Hide WordPress Sidebar on Mobile

Third, Elementor users to hide the sidebar method

Elementor page builderThe following operations can be performed:

  • Edit page → check the container where the sidebar is located
  • Click on the "¡ÓAdvanced" → "Responsive"Tabs
  • Check the box "Hide on mobile"

this approachDoes not affect desktop layoutIdeal for custom page users

Image [4] - Practical ways to hide WordPress sidebar on mobile
Image [5] - A Practical Way to Hide WordPress Sidebar on Mobile

The

Fourth, use the theme settings to hide

Some themes (e.g. Astra, GeneratePress, OceanWP) come with aresponsiveLayout settings that can be:

  • leave for"Appearance → Customize
Image [6] - A Practical Way to Hide WordPress Sidebar on Mobile
  • Finding the "-a side-bar (in software)"Setting
  • Setting up the "Mobile Layout" as "no sidebar"
Image [7] - A Practical Way to Hide WordPress Sidebar on Mobile

Fifth, with the help of plug-ins to achieve

If you don't want to write CSS, you can also use the plugin to freely control the display rules of the sidebar.

  • Widget Options Provide "Device Show" option for each gadget, support enable/hide by device type.
Image [8] - A Practical Way to Hide WordPress Sidebar on Mobile
  • Elementor Pro(Conditional display) Supports displaying blocks by device, customized conditions, but needs to bepaid versionSupport.
Image [9] - A Practical Way to Hide WordPress Sidebar on Mobile

VI. Notes and recommendations

  • The hiding method should be mobile-only to avoid impacting the desktop experience
  • It is recommended to backup the theme or child before operationthematicCSS
  • Use the cache plugin and clear the cache before testing the hiding effect
  • Authentication can be done via browser "mobile device mode" or real access from a cell phone

VII. Summary

Hiding mobile sidebars can improve the reading experience and loading speed. This can be done via CSS, theme settings, orVisualization EditorEasy to implement, simple to operate and does not affect the computer display. By choosing the right method according to the site structure, you can make mobile access more efficient.


Contact Us
Can't read the tutorial? Contact us for a free answer! Free help for personal, small business sites!
Customer Service
Customer Service
Tel: 020-2206-9892
QQ咨询:1025174874
(iii) E-mail: info@361sale.com
Working hours: Monday to Friday, 9:30-18:30, holidays off
© Reprint statement
This article was written by Toast
THE END
If you like it, support it.
kudos816 share (joys, benefits, privileges etc) with others
commentaries sofa-buying

Please log in to post a comment

    No comments