Skip Navigation

[Resolved] Adding a CSS class and/or ID to an entire view block

This support ticket is created 4 years, 9 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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: Asia/Kolkata (GMT+05:30)

This topic contains 1 reply, has 2 voices.

Last updated by Minesh 4 years, 9 months ago.

Assisted by: Minesh.

Author
Posts
#1589261

I am able to use the "Advanced" setting to add classes and/or IDs to blocks within a view or view loop, but can't figure out how to do so at the entire View block level.

I'd expect that in the View block settings (along w/ Custom Search, Query Filter, etc) there'd be one to add a class or ID to the whole wrapper class.

Please let me know if I'm missing this or if there's an alternate way.

My goal is to target this selector...

`.js-wpv-loop-wrapper > div`

... with something more precise.

Any advice appreciated.

#1589345

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I do not see a way to add a additional class to the div with class name:`.js-wpv-loop-wrapper > div`

You may file a feature request for the same to allow users to add a custom CSS ID or Class to Loop Output section. You can file a new feature request using the following form:
=> https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

For now, the only way I can see using which you can assign the custom CSS class to `.js-wpv-loop-wrapper > div` is by adding the custom jQuery/JS code to your view's Custom JS and CSS section.

You should try to add the following code:

jQuery(document).ready(function($){

$(".js-wpv-loop-wrapper").addClass("myclass");

});

Where:
- replace myclass with your CSS class name.