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?
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
Suberp. Glad to hear it's a known bug and will be fixed.