Tag Info

New answers tagged

1

First of all thanks to toscho for his solution. In case anybody needs the code for his theme instead of using it as a plugin here is the adopted code rewritten as a single function: add_shortcode('wp_caption', 'img_caption_add_description'); add_shortcode('caption', 'img_caption_add_description'); function img_caption_add_description($attr, $content = null) ...


0

You need add some CSS to make it auto clear left after each 3th item and need to hide <br> tag Update your code like this- /* For displaying 3 columns on tablet */ @media only screen and (max-width: 800px) { .gallery-columns-5 .gallery-item { width: 33% !important; } .gallery-columns-5 br { display: none; } ...


2

I am working on something that uses images in a very similar fashion. As mentioned, you will need to implement custom meta boxes for your 'product' post type to create an image field. I use the CMB2 framework to build out the meta boxes. It provides several field types, one of which is file_list. File_list allows you to set multiple images via the ...


1

In the admin panel, select custom CSS and add this code: .gallery-image { width: 30%; } That will increase the image width pushing the 4th image down to the next line :)


0

// Replace the title of img tag with image caption function wpdocs_filter_gallery_img_atts( $atts, $attachment ) { $attachment = get_post( $attachment->ID ); if ( $caption = $attachment->post_excerpt) { $atts['title'] = $caption; } return $atts; } add_filter( 'wp_get_attachment_image_attributes', ...



Top 50 recent answers are included