Support » Plugin: Links in Captions » [Plugin: Links in Captions] Problem with image height

  • Kristina


    I have a problem with the way photos are rendered when using a caption. I think it has something to do with WordPress but I think Links in Captions can help.I’ve been using this plugin for months now and I have to say I absolutely *LOVE* it! It has helped me tremendously with outfit credit links in my fashion blog’s outfit photos.

    One problem is I need to define the image’s height…much like the width is pulled from the image properties for the <div></div> wrapper around the caption, I need something like a &height to be grabbed as well and defined in the div. Is this possible? The reason being that unless the height is defined, i get a weird 3-5px gap of whitespace underneath my captioned photo.

    		'id'	=> '',
    		'align'	=> 'alignnone',
    		'width'	=> '',
    		'caption' => $caption
    	), $attr));
    	# BEGIN Added for this plugin
    		// replaces {link rel="nofollow" url=""}Text{/link}
    		$caption = preg_replace('/\{link(.*?)\}(.*?)\{\/link\}/ism', '[add_caption_link$1]$2[/add_caption_link]', $caption);
    		$caption = preg_replace('/\{a(.*?)\}(.*?)\{\/a}/ism', '[add_caption_link$1]$2[/add_caption_link]', $caption);
    		// Added for this plugin it replaces {link rel="nofollow" url="" text="Text" /}
    		$caption = preg_replace('/\{a(.*?)\/\}/ism', '[add_caption_link $1 /]', $caption);
    		$caption = str_replace('&quot;', '"', $caption);
    	# END Added for this plugin
    	if ( 1 > (int) $width || empty($caption) )
    		return add_link_to_caption_replace_quotes($content, 'remove');
    	if ( $id ) $id = 'id="' . esc_attr($id) . '" ';
    	// Added do_shortcode() to the $caption for this plugin
    	return '<div ' . $id . 'class="wp-caption ' . esc_attr($align) . '" style="width: ' . (0 + (int) $width) . 'px">

    I believe the solution would be somewhere in the above code?

  • The topic ‘[Plugin: Links in Captions] Problem with image height’ is closed to new replies.