WordPress.org

Ready to get started?Download WordPress

Forums

Galleria Galleria
[resolved] Image links? (4 posts)

  1. mpmchugh
    Member
    Posted 3 years ago #

    It'd be nice if the images can link to the Link URL in the gallery image settings.

    Is there a way to do this?

    -Michael

    http://wordpress.org/extend/plugins/galleria-galleria/

  2. Sam Margulies
    Member
    Plugin Author

    Posted 3 years ago #

    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.

  3. mpmchugh
    Member
    Posted 3 years ago #

    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 http://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?

  4. Sam Margulies
    Member
    Plugin Author

    Posted 2 years ago #

    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');

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic