I got this with the help of Chat GPT3. It worked after a few tweaks
<script>
document.addEventListener('DOMContentLoaded', function() {
var galleryContentWrapper = document.querySelector('.gallery-caption-wrapper');
var blockId = '#block-yui_3_17_2_1_1691321700096_2268'; // Replace 'xxx' with the actual identifier of the block
if (galleryContentWrapper) {
var footerBlock = document.querySelector(blockId);
if (footerBlock) {
footerBlock.style.display = 'block'; // Show the block in the footer
}
} else {
// If the gallery-content-wrapper element is not present, you can hide the block or handle it as needed
// For example, to hide the block:
var footerBlock = document.querySelector(blockId);
if (footerBlock) {
footerBlock.style.display = 'none';
}
}
});
</script>