Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #165295

    Greetings –

    I would like to modify the lightbox popup/nav code that is generated by the ‘av_gallery’ shortcode to more closely emulate how the default WP ‘gallery’ works. The WP ‘gallery’ shortcode places each included media item’s Title in the description area below each picture, just to the right of the nav buttons, but the ‘av_gallery’ code tends to put the media item’s Description (text field) in that area. This difference ends up being significant on my site.

    I believe I’ve found the code which generates the relevant gallery code in wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/gallery.php. Can you confirm that the shortcode_handler() function is the right code to modify?

    Also – I am using enfold-child, and therefore can you confirm the correct procedure to override that function? Do I create a copy of the path/file from the parent, or do I simply place a modified function in the child theme’s functions.php?

    Thanks!

    #165700

    I’m wondering if anyone had a chance to consider my question?

    #167290

    Hi!

    Have you tried just using the regular WordPress gallery shortcode and not using the element in the template builder?

    Cheers!
    Devin

    #172179

    I would like to know this very same thing. and for sure implemented with a child theme.

    As a photographer I upload hundreds of images in galleries and want the names visible in the lightbox. The titles are auto generated on upload but I can’t spend the time to copy paste these in the descriptions for hundreds of images every few days. If using the default wordpress shortcode for a gallery changes the appearance of the gallery layout I wouldn’t’ want to do that. Also if I am not mistaken you have to just use the visual editor and then if you wanted to make any sort of change after you create it it is a hassle.

    So it would be best if we could us the template builder but have the change in the code. Please, if you can take the time to describe fully how to implement this change as it is very important to me. Thanks.

    #173650

    Hello!

    You should be including all of that information in the meta data for the photos anyway in that case. WordPress will then autofill in the fields with the embedded data and display it.

    And if you wanted to use the default WordPress gallery function it can be placed into a regular text field element using the built in WordPress add media/gallery tools.

    Best regards,
    Devin

    #177588

    ok Devin I tried adding the default wordpress media gallery into a text field which allows you to still use the advanced editor, and also just using the default view and placing that way. In both cases you are right the default galleries automatically include the image title into the bottom of the lightbox. Exactly what I want.

    But there is a glaring problem with this. Of course they get no styling like the enfold galleries. I want the sexyness of the enfold gallery but the funtionality of the default gallery. For you folks with skills this shouldn’t be too hard to implement into a child theme.

    As of right now you already are… sort of. When you view a featured image for a blog post in the light box it appends the title name above the image in the lightbox. It doesn’t place it at the bottom IN the normal location but either way it is satisfactory. So you are already tapping into this with enfold.

    So please try to help if you can on how to implement adding the image title name in to the lightbox when you view the thumbnails in a gallery built with the enfold layout builder. But on a child theme setup.

    Thank you. This is super important for me to get this implemented as soon as possible. I need clients to be able to view and reference that unique name when looking at their images.

    #178319

    Hi!

    You can use following function:

    
    add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1);
    function avia_include_shortcode_template($paths)
    {
    	$template_url = get_stylesheet_directory();
        	array_unshift($paths, $template_url.'/shortcodes/');
    
    	return $paths;
    }
    

    to overwrite shortcodes with your child theme. Just place it in the child theme functions.php file, then create a folder called “shortcodes” in the child theme folder and insert the gallery.php file into it. Then open up gallery.php and replace

    
                            $title = trim($attachment->post_title) ? esc_attr($attachment->post_title) : "";
                            $description = trim($attachment->post_content) ? esc_attr($attachment->post_content) : "";
    

    with

    
                            $description= trim($attachment->post_title) ? esc_attr($attachment->post_title) : "";
                            $title = trim($attachment->post_content) ? esc_attr($attachment->post_content) : "";
    

    Best regards,
    Peter

    #178730

    Peter,
    Thank you so much. That worked perfectly.

Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘Display Media item Title instead of Media item Description in Lightbox’ is closed to new replies.