Set Featured Image for Archive templates

There are lots of archives in WordPress. Tag archives, date archives, category archives, term archives, author archives. Which archive do you mean? You could start by trying the Taxonomy Images plugin http://wordpress.org/extend/plugins/taxonomy-images/

the_post_thumbnail with lazyload JQ plugin

If you want to apply lazyload to each attachment image, you can just add your hoot to wp_get_attachment_image_attributes filter: add_filter( ‘wp_get_attachment_image_attributes”https://wordpress.stackexchange.com/questions/54986/,”wpse8170_add_lazyload_to_attachment_image’, 10, 2 ); function wpse8170_add_lazyload_to_attachment_image( $attr, $attachment ) { $attr[‘data-original’] = $attr[‘src’]; $attr[‘src’] = “https://wordpress.stackexchange.com/questions/54986/grey.gif”; return $attr; } Or if you can use second approach: $thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), “size” ); // … Read more

Display Category Thumbnail and links in Woo commerce

Have did some customization. This will help you show parent and child category images. You can later customize this code as per your requirements. $taxonomyName = “product_cat”; //This gets top layer terms only. This is done by setting parent to 0. $parent_terms = get_terms($taxonomyName, array(‘parent’ => 0, ‘orderby’ => ‘slug’, ‘hide_empty’ => false)); echo ‘<ul>’; … Read more

Featured image shortcode

Register the shortcode, ideally in a plugin or functions.php if you have to. add_shortcode(‘thumbnail’, ‘thumbnail_in_content’); function thumbnail_in_content($atts) { global $post; return get_the_post_thumbnail($post->ID); } Add the shortcode to you post content. [thumbnail] If you want more features, see this post or the pastebin. ADDING CAPTIONS AND LINKS add_shortcode(‘thumbnail’, ‘thumbnail_with_caption_shortcode’); function thumbnail_with_caption_shortcode($atts) { global $post; // Image … Read more

Getting Thumbnail Path rather than Image Tag

Thumbnail is essentially attachment so you can approach from that side – lookup ID with get_post_thumbnail_id() and fetch data with wp_get_attachment_image_src(), like this: if (has_post_thumbnail()) { $thumb = wp_get_attachment_image_src(get_post_thumbnail_id(), ‘thumbnail_name’); echo $thumb[0]; // thumbnail url } (source)

Auto-retrieve YouTube Image for Thumbnail?

Hi @Jonathan Sampson: While this is not exactly what you asked for it might actually be a viable solution and it comes for free from WordPress.com thanks to @yoast‘s tweet this morning when he referenced this blog post: An Automated Way to Take Screenshots of any Website – Free Basically you can use WordPress.com’ screenshot … Read more