Include caption underneath post images

the following should just show the caption: echo ‘<div class=”slideshow-content”><img src=”‘.wp_get_attachment_url($attachment->ID, ‘thumbnail’, false, false).'” /><div class=”captions”>’.apply_filters(‘the_excerpt’, $attachment->post_excerpt).'</div></div>’; (applying the excerpt filter adds the paragraph tag automatically)

Removing height and width from images with a caption

Here is another possibility, it alters the image markup when you select an image to add to your content in the editor add_filter( ‘image_send_to_editor’, ‘remove_img_attribute’, 10, 8 ); function remove_img_attribute( $html, $id, $caption, $title, $align, $url, $size, $alt ) { $imagetpl=”<figure> <a href=”https://wordpress.stackexchange.com/questions/129666/%s” title=”https://wordpress.stackexchange.com/questions/129666/%s”><img src=”https://wordpress.stackexchange.com/questions/129666/%s” alt=”https://wordpress.stackexchange.com/questions/129666/%s” class=”img-responsive %s” /></a> %s </figure>”; $figcaption = (!empty($caption)) ? … Read more

Showing image description along with embedded links below post images

When you look at the last line img_caption_shortcode(), then you can see wp_kses() stripping non allowed HTML tags there. The wp_kses_hook() function does only wrap a filter: return apply_filters( ‘pre_kses’, $string, $allowed_html, $allowed_protocols ); which allows to hook in and alter the output before wp_kses_split() finally removes the HTML tag by using preg_replace_callback with _wp_kses_split_callback() … Read more

Add post-thumbnail after first paragraph including the caption

Something like this should work add_filter( ‘the_content’, ‘insert_featured_image’, 20 ); function insert_featured_image( $content ) { global $post; if ( has_post_thumbnail($post->ID) ) { $thumbnail_caption = get_the_post_thumbnail_caption( $post ); if ( $thumbnail_caption ) $caption = ‘<span class=”image-caption”>’ . $thumbnail_caption . ‘</span>’; else $caption = ”; // You can set this to whatever you want. $img = ‘<p>’ … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)