Hi @vcb – I’m not aware of any lightbox effects built into Core, either in the Gallery block or elsewhere. You could look for a plugin that might do this, though.
Thread Starter
vcb
(@vcb)
Thanks for the note Kathryn. You’re right, I already installed a Lightbox Plugin which works on the Gallery. But I’d need to get this working on feature images too. Do you know where I can change the php code?
The new “framework” of twenty-twenty-three kinda excludes php from the template file. This makes it weird editing; compared to older versions.
I try to avoid the “designer” and prefer working in code. Having a hard time with the new theme … Any help/tipp is very welcome, thanks.
Thread Starter
vcb
(@vcb)
WORKAROUND: I’ve installed lightbox photoswipe and created a custom function/shortcode which I then implement into templates by using:
//add the following to your child-theme overwrite templates.html
< !– wp:shortcode — >
[your-custom-shortcode]
< !– /wp:shortcode — >
//*remove the spaces < !– + — > !!!
//add the following to functions.php
add_shortcode( ‘your-custom-shortcode’, ‘shortcode1’ );
function shortcode1( $atts ) {
//return “foo = {$atts[‘foo’]}”;
return ‘DO WHAT YOU WANT’;
}
This is kinda … yeah; in case someone got a better option; please share it with us. Thanks.
-
This reply was modified 2 years, 10 months ago by
vcb.
-
This reply was modified 2 years, 10 months ago by
vcb.
Glad you found a child-theme workaround, thanks for sharing it!
For anyone else coming across this, changes like the above should be made in a child theme – not in the theme files directly – otherwise your changes will be overwritten and lost every time there’s a theme update. For making a child theme from a block theme like Twenty Twenty-Three, I recommend using the child-theme option built into Create Block Theme.