Skip Navigation

[Resolved] Hide the third columns on small screens

This thread is resolved. Here is a description of the problem and solution.

Problem:
The user is using a grid view with 3 columns and would like to hide the 3rd column on small screens.

Solution:
You can use views shortcodes to apply specific style the 3rd column. Use:

  • Limit the view to 3 results.
    - wpv-loop attribute "wrap=3" to build a view with set of 3 results.
  • use wpv-item attribute "index=3" to apply a different style on the 3rd result.
  • Use responsive utilities from Bootstrap, or build your own style to hide the 3rd column for any screen size you want.

Relevant Documentation:

This support ticket is created 4 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 4 replies, has 2 voices.

Last updated by Pete 4 years, 8 months ago.

Assisted by: Jamal.

Author
Posts
#1589421

Hi Jamal,

Thank you for that however I never knew that was there, I didn't know there was an override setting in Elementor that affected Toolset. I know now 🙂

Ok, I added this to get the row down to 2 columns for table so I now have: <div class="col-sm-4 col-sm-6">

Works great however I can remember a method of stopping the third item wrapping round underneath, however I can't find this.

I already have this and tried to adapt it however no joy:


@media (min-width: 625px) and (max-width: 1580px) {
.row-family .col-sm-4:nth-child(n+4) {
display: none;
}
}

@media (min-width: 625px) and (max-width: 1580px) {
.row-family .col-sm-4 {
width: 50%;
}
}

Any ideas please?

#1589429

I am not really sure how to do it on CSS. But you can use Bootstrap responsive classes such as "hidden-sm" and similar check this section of bootstrap documentation hidden link

As you are using the wrap attribute of wpv-loop and the index attribute of wpv-item, I suppose you can add the bootstrap responsive utilities to hide the 3rd column on small screens:

		[wpv-item index=3]
			<div class="col-sm-4 col-sm-6 hidden-xs hidden-sm">[wpv-post-body view_template="loop-item-in-related-lakes"]</div>
		</div>

Please test it and let me know if it helps.

#1589517

Hi there,

Ok, well I added your suggestion and I checked out the docs link. I've added hidden-md to try and hide this third column on smaller PC screens, which helped however there seems no setting for 1280 x 768.

It feels like this needs a CSS option as the resolution this is missing is a popular media query and curious why BS hasn't covered this. Unless I'm doing something wrong?

<div class="row-family">
<div class="col-sm-4 col-sm-6">[wpv-post-body view_template="loop-item-in-related-lakes"]</div>
[wpv-item index=other]
<div class="col-sm-4 col-sm-6">[wpv-post-body view_template="loop-item-in-related-lakes"]</div>
[wpv-item index=3]
<div class="col-sm-4 col-sm-6 hidden-md hidden-xs hidden-sm">[wpv-post-body view_template="loop-item-in-related-lakes"]</div>
</div>

#1589631

Bootstrap is trying to adopt the mobile-first approach, default styles are applied to the small screen supported, then using media queries, bootstrap provide additional styles for bigger screens.
hidden link

Check the grid options(screen sizes) of bootstrap CSS here hidden link

You may fix this by using the ".visible-md-*" ".visible-lg-*" classes instead of the ".hidden-xs-* .hidden-sm-*" classes.

I am sure, you will understand, that this is a question related to Bootstrap CSS rather than Toolset. As Toolset supporters, we can give some guidance on how to use Bootstrap, we may also provide solutions when it is simpler, but we can't build custom solutions for our customer.
If you are not comfortable with technical skills(CSS, Javascript, PHP), you can take this question to a general support website such as StackOverflow or consider hiring a developer or one of our partners https://toolset.com/forums/forum/professional-support/

#1589697

My issue is resolved now. Thank you!