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

the_post_thumbnail() Custom sizes not display correctly

If the critical dimension is height, you have a couple options: Hard-cropping to the exact width/height: <?php add_image_size( ‘wide-image-icon’, 200, 150, true ); ?> The hard-crop will create a thumbnail size using the exact dimensions. Be sure that all images have a minimum width/height as what is defined. Or soft-cropping (i.e. “box-resizing”) constrained to height: … Read more

Setting a default placeholder image WITHOUT link

<div class=”imageContainer”> <?php if ( has_post_thumbnail() ) : ?> <a href=”https://wordpress.stackexchange.com/questions/63591/<?php the_permalink(); ?>”><?php the_post_thumbnail(‘size-2’); ?></a> <?php else : ?> <img src=”<?php echo get_bloginfo( ‘stylesheet_directory’ ); ?>/images/shared/placeholder.jpg” /> <?php endif; ?> </div>

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