Remove inline width from figure

I add an image with caption to my page and need to increase <figure> width. But wordpress is adding an inline width. So, the DOM look like this: <figure id=”attachment_43″ aria-labelledby=”figcaption_attachment_43″ class=”wp-caption alignnone” style=”width: 216px”> <a href=””> <img src=”http://localhost/bordados/website/wp-content/uploads/2014/02/homeThumb01.jpg” alt=”Caption” width=”216″ height=”95″ class=”size-full wp-image-43″> </a> <figcaption id=”figcaption_attachment_43″ class=”wp-caption-text”>Caption.</figcaption> </figure> I try to remove width=”216″ from … Read more

Include captions

I’m using the Meta Box plugin, everything works fine. I’m using it to create gallery function on some custom post type, and I’m able to display the uploaded images using this code: global $wpdb; $meta = get_post_meta( get_the_ID(), ‘meta_key’, false ); if ( ! is_array( $meta ) ) $meta = ( array ) $meta; if … Read more

wp_get_attachment_caption to pull Image Caption or alt

$output .= ‘ <img class=”class1″ src=”‘.$atts[‘to’].'” alt=”The First Caption” width=”100%” height=”auto” >’; Instead of first caption, I want to fetch the caption/description of the image. can some one guide me how to do this? I tried this → wp_get_attachment_caption but it didn’t work. 1 Answer 1 You can directly get an attachment’s meta data if … Read more

Different captions for the same image in multiple galleries. Edit Image in Gallery locally

I would like to show different captions for the same image, used in multiple galleries. Apparently it is not possible to save the caption of an image without changing that caption in all other occurences of the same image in other galleries as well. Pretty much the same question was asked here : How to … Read more

Add extra class to wp-caption?

How do you add a new class to the HTML generated when an image with captions is added? For example, from this: <div id=”attachment_xyz” class=”wp-caption alignleft”… to this: <div id=”attachment_xyz” class=”wp-caption alignleft my_new_class”… Adding, in this case, my_new_class. Thanks, Scott 2 Answers 2 Adapted from this answer Add this code to your functions.php file: add_action( … Read more