Show LightBox when clicking on featured image [closed]

If you use the following code you may fix your problem. Give it a try.Paste this in your post.php <?php if ( current_theme_supports( ‘get-the-image’ ) ): $image_full=wp_get_attachment_image_src(get_post_thumbnail_id( $post->ID ), ‘full’); $image_thumbnail=wp_get_attachment_image_src(get_post_thumbnail_id( $post->ID ), ‘single-thumbnail’); ?> <a href=”https://wordpress.stackexchange.com/questions/194146/<?php echo $image_full[0]; ?>” rel=”lightbox”> <img class=”alignnone wp-image-2770 size-single-thumbnail” src=”<?php echo $image_thumbnail[0]; ?>” alt=”2015-04-10_190211″ width=”636″ height=”460″ style=”opacity: 1;”> </a> … Read more

Lazyload post thumbnails

You got everything you need, simply build your own img-element like this: if ( has_post_thumbnail() ) { $class=”lazy attachment-thumbnail-400-300″; //Get thumbnail source $thumb = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), ‘thumbnail-400-300’); $src = $thumb[‘0’]; $placeholder = “//placehold.it/400×300/eee/222/&text=+”; echo ‘<img src=”‘.$placeholder.'” data-original=”‘.$src.'” class=”‘.$class.'” />’; } Besides that, your main performance issue might be generating a new placeholder every time you want … Read more

How to access featured image?

get_the_post_thumbnail ( $post/$post_id, $sizes, $attr ) will give you the featured image as html to output. get_post_thumbnail_id ( get_the_ID ( ) ) will give you the ID of the featured image so you can use it to get more information. Getting the thumbnail ID is essentially accessing the the post’s meta data: $image_id = get_post_meta( … Read more

Change size and crop medium_large images

You can call add_image_size() again to update the existing image size. Assuming it is called medium_large (Events Manager Pro is a paid plugin so not very much people have it) you can do something like: <?php function update_medium_large_size_wpse216595() { add_image_size( ‘medium_large’, 600, 255, array( ‘center’, ‘top’ ) ); } add_action( ‘init’, ‘update_medium_large_size_wpse216595’, 11 ); Then … Read more

100% width Featured Image Size

Ack, nevermind I just discovered that using get_the_post_thumbnail( $post_id, ‘full’ ); // Original resolution will use the width and height of the featured image. I do apologize for wasting everyone’s time. I should have been a little more patient 😉