Home Forums Community Forum Just need a title below my gallery images :(

Only users with a registered purchase of Avada can post to the community forum. Please register your purchase here.
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • dburney
    Participant
    Post count: 7

    It seems there’s no easy way to do this. My client needs a simple 3-4 column gallery that displays product images and the title beneath the product. Clicking the image or the name would open the lightbox. There is no need for a linked page – so I don’t think Portfolio will work. Even if I hide the hover box elements for the portfolio thumb – the title links to the page – not to the lightbox.

    For whatever reason, I can’t find a single gallery plugin that does this. I would think calling the title and centering it beneath the thumbnail wouldn’t be so hard.

    Any recommendations or advice would be greatly appreciated. Thanks in advance.

    Christian
    Participant
    Post count: 23

    Theme options, Lightbox, –> activate lightbox
    Theme options, Lightbox, –> activate Title
    Theme options, Woocommerce, Shop –> products = 4

    Use Woocommerce Shortcode to make your page with products

    https://docs.woocommerce.com/document/woocommerce-shortcodes/

    dburney
    Participant
    Post count: 7

    Thanks. I’ll give that a try.

    dburney
    Participant
    Post count: 7

    Thanks Clyon for your suggestions. Unfortunately that still creates individual pages for the product. And adds some unnecessary plugin overhead.

    The client is a motorsports company that just needs their current inventory viewable as a gallery. We’re not to the point with traffic or budget to build out pages for each motorcycle in inventory. Ideally I bulk upload my images and a gallery is built with just a thumbnail and title that links to lightbox.

    Here’s where I am using the Avada Gallery…

    https://www.dropbox.com/s/jdehfwrkarnq0uk/Screen%20Shot%202020-02-13%20at%208.32.29%20AM.png?dl=0

    Christian
    Participant
    Post count: 23

    Ok, you need a store where you show the Vespa category with products that when you click show the lightbox.

    What is the link to your website?

    dburney
    Participant
    Post count: 7

    Hi Christian – I’m not sure a “store” is necessary. I did find a gallery plugin that I can purchase that will accommodate showing “Title” or “Title/Caption” beneath the thumbnail image. Here’s the demo.

    https://www.imagely.com/wordpress-gallery-plugin/pro-thumbnail-gallery-views/

    Was hoping I could do something similar to the “Caption” options at the bottom.

    I appreciate your help.

    marklchaves
    Participant
    Post count: 572

    Hey Everyone,

    Interesting problem.

    I created a custom filter to overwrite the default gallery caption code in media.php. I overwrite the default image gallery captions with the title</strong. and/or caption from the media attachment meta.

    I posted my solution on GitHub.

    https://gist.github.com/marklchaves/1116bba6fcd9688b4df5b121d5d76277

    I welcome any feedback or other non-plugin approaches.

    Thanks!

    dburney
    Participant
    Post count: 7

    marklchaves – that almost works perfectly for me. I’ve only ran into two drawbacks. The first, which is not too bad – I have to style each gallery individually. The second though is in regards to responsive design. The gallery is not responsive at all and shrinks the columns and thumbnails to fit the screen width instead. Though this may be an issue with WP Gallery in general. I’ve never used it as I’ve always use the Fusion Gallery element. If you have any insights into this, please let me know. I’ll share a link once the site is live.

    marklchaves
    Participant
    Post count: 572

    Hi @dburney,

    Cool. Thanks for the follow-up.

    Basically, you can specify tags in the shortcode and override the gallery classes.
    I updated the Gist with styling options including media queries for mobile and tablet.

    https://gist.github.com/marklchaves/1116bba6fcd9688b4df5b121d5d76277

    I hope that helps!

    dburney
    Participant
    Post count: 7

    @marklchaves – that was the last piece I needed. Thanks for your help!

    marklchaves
    Participant
    Post count: 572

    Hi @dburney,

    Excellent. Sorry for the late reply. Ok–there’s one more step unless you beat me to it.

    I wasn’t able to override the core gallery_shortcode() before. I found the issue and fixed it.

    I suggest you now move your customisation from the /wp-includes/media.php into your child theme’s functions.php file. We don’t want those changes to be overwritten on the next WordPress upgrade. I hope this makes sense.

    I added these steps to my Gist.

    Summary of the Process

    1. Copy your modified gallery_shortcode() function from wp-includes/media.php to your child theme’s functions.php file.
    2. Undo the customisations from the core media.php file. You can see the original code snippet on my Gist if you don’t have it. Or, just leave it alone since you are overriding it anyway. Your call.
    3. Rename your copied gallery_shortcode function.
    4. Add two more lines of code above your custom function to override the core gallery_shortcode.

    This must go above your new custom function.

    
    /**
     * Override the WordPress core media.php gallery_shortcode().
     */
    remove_shortcode('gallery', 'gallery_shortcode');
    add_shortcode( 'gallery', 'my_gallery_shortcode' );
    

    Shout if you have questions!

    • This reply was modified 1 month, 2 weeks ago by marklchaves. Reason: Clarification
    marklchaves
    Participant
    Post count: 572

    Update

    I developed a plugin to add the caption filter hook and override the gallery shortcode in media.php. So, all anyone using the plugin has to do is just write the filter and add it to their child theme’s functions.php file.

    The plugin, Gallery Image Captions (GIC), was published yesterday 7 March 2020.

    Shout if you have any qestions 😉

Viewing 12 posts - 1 through 12 (of 12 total)
Only users with a registered purchase of Avada can post to the community forum. Please register your purchase here.