Reply To: Caption below image

Home Forums Support Caption below image Reply To: Caption below image

Home Forums Support Caption below image Reply To: Caption below image

#71682
Tom
Lead Developer
Lead Developer

Ah – I see what you mean about the distortion.

WordPress natively adds 10px to the caption width in order to give the image a border look – which in my opinion is an old, over-used style.

You can remove this extra padding by adding this PHP snippet using a plugin like this: https://wordpress.org/plugins/code-snippets/

function generate_remove_caption_padding( $width ) {
	return $width - 10;
}
add_filter( 'img_caption_shortcode_width', 'generate_remove_caption_padding' );

I would add it to the core of GP, but WP.org most likely would reject it as it alters default WordPress behavior.

As for the link colors, this will make it so the hover goes black:

.wp-caption .wp-caption-text a, 
.wp-caption .wp-caption-text a:visited {
	color:#359BED;
	text-decoration: underline;
}

.wp-caption .wp-caption-text a:hover {
	color: #222;
}