Post thumbnails in sidebar & footer?

You probably want to define a size for post thumbnails for this side-bar area first. This needs to be registered with your theme so you can refer to it later one. Then you can make use of the get_the_post_thumbnail() function passing the ID of the post as well as your post thumbnail size name as … Read more

Post thumbnail not working after regenerate

Look at the wp-content/uploads/ directory. Does your cropped image exists there? (e.g. myimage-185×185.jpg). If not, you could try to call add_image_size() on the init action hook. functions.php function wpse27579_addImageSizes() { add_image_size(‘thumbnail-gallery’, 185, 185, true); } add_action(‘init’, ‘wpse27579_addImageSizes’);

Featured image for first post only

You can use the_post_thumbnail() to output the thumbnail image directly. <?php $count = 1; ?> <?php while (have_posts()){ the_post(); ?> <article id=”<?php echo $post->post_name; ?>” class=”post<?php post_class(); ?>” itemscope itemtype=”http://schema.org/Article”><?php if ($count == 1 && has_post_thumbnail( get_the_ID() ) ){ the_post_thumbnail(‘blog-thumbnail’, array(‘class’ => ‘banner’, ‘item_prop’ => ‘image’)); } $count++; ?> <header> <h1 itemprop=”name”><a href=”https://wordpress.stackexchange.com/questions/35617/<?php the_permalink(); ?>” … Read more

Exclude featured image from gallery code stops Lightbox from working

I solved this by using this code function exclude_thumbnail_from_gallery($null, $attr) { if (!$thumbnail_ID = get_post_thumbnail_id()) return $null; // no point carrying on if no thumbnail ID // temporarily remove the filter, otherwise endless loop! remove_filter(‘post_gallery’, ‘exclude_thumbnail_from_gallery’); // pop in our excluded thumbnail if (!isset($attr[‘exclude’]) || empty($attr[‘exclude’])) $attr[‘exclude’] = array($thumbnail_ID); elseif (is_array($attr[‘exclude’])) $attr[‘exclude’][] = $thumbnail_ID; // … Read more