No, unfortunately that is not possible either. You could only develop something like that in a separate Gutenberg block.
What is your goal of the whole thing?
Hmm, bummer. The goal is to animate those individual post items – maybe have them fade in one-at-a-time or something. For the CSS/JS solution we’re using, we need specific class(es) on the element that needs to be animated.
I’m not sure we would want to re-engineer the entire Query Loop Block just for something like this.
– Would I need to develop a javascript method of attaching the classes to those elements or something?
You can also use hooks in Gutenberg to change blocks. It is not necessary to develop everything from scratch.
If you want to give all query loops an additional class in general, the hook blocks.getSaveContent.extraProps should be sufficient. Minimal example, untested:
const enableBlocks = [
'core/query-pagination'
];
import classnames from 'classnames';
const addClassToQueryLoop = ( extraProps, blockType, attributes ) => {
// Do nothing if it's another block than our defined ones.
if ( !enableBlocks .includes( blockType.name ) ) {
return extraProps;
}
return extraProps.className = classnames(extraProps.className, 'your-extra-class');
};
wp.hooks.addFilter(
'blocks.getSaveContent.extraProps',
'my/example',
addClassToQueryLoop
);
Alternatively, you can of course specify that each editor should enter this class manually in the CSS Classes field under Extras.
If you do not want to add this class to every QueryLoop, you would have to add a tick. This would have to be added as an attribute to the query loop via the hook blocks.registerBlockType. And as a field via Hook editor.BlockListBlock. Examples can be found in the manual: https://developer.ww.wp.xz.cn/block-editor/reference-guides/filters/block-filters/