WordPress.org

Support

Support » Themes and Templates » Sunspot » [Resolved] Is it possible to hide some objects while in mobile view?

[Resolved] Is it possible to hide some objects while in mobile view?

  • I’ve created a child theme with a page template that has a six-column table. Obviously this table is too big to look good in mobile view. Is there a way to modify my php so that some specific columns are hidden when mobile view is activated? I’m very new to the concept of mobile view; I’m still trying to grasp what’s possible and what’s not.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You don’t need to edit PHP.
    You can do it using media query in CSS.

    For example, you want to hide 3 elements with class, .element1, .element2, .element3.
    Then you can hide these elements in mobile by following code.

    @media (max-width: 480px){
    .element1, .element2, .element3 {
            display: none;
    }

    That’ll hide these 3 elements from device with width less or equal to 480px but you can choose whatever you want.

    Thank you! I’m sure this will be very helpful for keeping my site accessible for mobile devices. I should have known the fix would be an easy one.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Is it possible to hide some objects while in mobile view?’ is closed to new replies.
Skip to toolbar