Skip Navigation

[Resolved] Toolset won't output custom classes on "WordPress Archive" element

This support ticket is created 3 years, 10 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: Asia/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by lukaszS-3 3 years, 10 months ago.

Assisted by: Waqar.

Author
Posts
#2001709
2021-03-26.png
2021-03-26 (1).png

I'm trying to create an archive using Toolset. In the top block element "WordPress Archive" I've added two CSS classes: "site-content" and "test-class" in the advanced section. They both look like default WordPress tags in the Gutenberg interface, so I assume the classes are indeed added.

However, after saving the archive and previewing it in the frontend, those classes are not being output (I did search in the raw HTML).

However, if I go to "WordPress Archive Loop" and add my classes there, they are being appended to each loop element independently, as intended.

I need to append classes to such master elements as I need them to be wrapped in containers for site width instead of full width. Apparently, I can't use container block to encapsulate the archives.

Is this a bug? Why classes in "Archive Loop" are being printed and those in "Archive" not?

#2001817

Hi,

Thank you for contacting us and I'd be happy to assist.

Your observation is correct and this issue has been reported to the concerned team already. The custom ID or classes added in the main "WordPress Archive" block are not included in the markup on the front-end.

A fix for this is planned to be covered in the 3.5 version of Views and 1.5 version of Blocks. For now, a workaround can be to either add your custom CSS styles to target the default div with class "wp-block-toolset-views-wpa-editor" or if you'd prefer adding a custom class to that div, you can include the following script in the WordPress Archive's "Custom JS":
( screenshot: hidden link )


jQuery(document).ready(function(){
    jQuery('.wp-block-toolset-views-wpa-editor').addClass('test-wrapper');  
});

Note: you'll replace "test-wrapper" with your own class name to add.

regards,
Waqar

#2002037

Suberp. Glad to hear it's a known bug and will be fixed.