Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Sam Margulies

    (@gluten)

    Unfortunately the way that Galleria’s themes work, they don’t really support linking images to the link url. You could try your hand at modifying the default Galleria theme to add this functionality.

    Thread Starter mpmchugh

    (@mpmchugh)

    Actually, it looks like they’ve recently added the ability to use image links:

    popupLinks

    type: Boolean
    default: false

    Setting this to true will open any image links in a new window. You can add image links using the longdesc attribute (default) or customize it using data_config

    This support page indicates that this functionality was fixed/added in 1.2.4 https://getsatisfaction.com/galleria/topics/need_some_basic_help_on_getting_an_image_to_link_to_a_url_in_miniml_theme

    Any possibility of an update to take advantage of this? i.e. having the plugin use the image link in the longdesc attribute somehow?

    Plugin Author Sam Margulies

    (@gluten)

    The problem is that Galleria Galleria uses the output of the default WordPress [gallery] and that doesn’t support the image link URL option. I do have somewhat of a hack you can use to get around this. If you download the latest beta version of the plugin, you can add a hook to modify the galleria settings. With that hook, you can tell galleria to use the image’s caption as the image link instead of the link URL by placing this code in your theme’s functions.php:

    function my_galleria_options() {
    	return "data_config: function(img) {
    		// will extract and return image titles and links from the source:
    		return  {
    			title: $(img).attr('title'),
    			description: '',
    			link: $(img).parents('.gallery-item').find('.gallery-caption').text(),
    		};
    	}";
    }
    add_filter('galleria_galleria_theme_options', 'my_galleria_options');

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Galleria Galleria] Image links?’ is closed to new replies.