• Resolved vcb

    (@vcb)


    How can I add the details so that the gallery lightbox also works on feature image? Thank you

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Kathryn Presner

    (@zoonini)

    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 1 year, 6 months ago by vcb.
    • This reply was modified 1 year, 6 months ago by vcb.
    Moderator Kathryn Presner

    (@zoonini)

    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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Lightbox for feature image’ is closed to new replies.