<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Webmaster-Source &#187; thumbnails</title>
	<atom:link href="https://www.webmaster-source.com/tag/thumbnails/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.webmaster-source.com</link>
	<description>Useful Resources For Webmasters</description>
	<lastBuildDate>Thu, 24 Aug 2017 02:01:18 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.42</generator>
	<item>
		<title>WordPress Post Thumbnails: Migrating from Custom Fields to the Featured Image API</title>
		<link>https://www.webmaster-source.com/2012/06/11/wordpress-post-thumbnails-migrating-from-custom-fields-to-the-featured-image-api/</link>
		<comments>https://www.webmaster-source.com/2012/06/11/wordpress-post-thumbnails-migrating-from-custom-fields-to-the-featured-image-api/#comments</comments>
		<pubDate>Mon, 11 Jun 2012 11:18:07 +0000</pubDate>
		<dc:creator><![CDATA[Matt]]></dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[thumbnails]]></category>

		<guid isPermaLink="false">http://www.webmaster-source.com/?p=4695</guid>
		<description><![CDATA[I had post thumbnails on this blog a long time before the feature became a part of the WordPress core. Some of you out there may have, too. The technique that was generally used before the friendly &#8220;Featured Image&#8221; box, and its associated theme API, was added to WordPress, we generally just pasting image URLs [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I had post thumbnails on this blog a long time before the feature became a part of the WordPress core. Some of you out there may have, too. The technique that was generally used before the friendly &#8220;Featured Image&#8221; box, and its associated theme API, was added to WordPress, we generally just pasting image URLs into custom fields and outputted them into an image tag in the theme. Basically, like I recommended <a href="http://www.webmaster-source.com/2008/10/30/wordpress-post-thumbnails/">in this old post from 2008</a>.</p>
<p>When WordPress 2.9 was released, bringing with it an &#8220;official&#8221; way to handle thumbnails, I was a little bit annoyed. I had tons of posts where I had existing thumbnails that would have to be somehow updated, or else I would have to come up with some clever way to be backwards-compatible. So I just put it out of my mind and left things the way they were&#8230;until this year.</p>
<p><a href="http://www.webmaster-source.com/2012/05/20/meet-webmaster-source-6-0/">Redesigning</a> gave me an excuse to modernize a lot of the stuff going on behind-the-scenes, and one of the things I improved was the handling of post thumbnails. The solution was easy: write a function to handle <em>two</em> methods of applying a thumbnail, and check both places for a thumbnail. The code looks something like this:<span id="more-4695"></span></p>
<pre class="brush: php; title: ; notranslate">
function my_smart_thumbnail($postid) {
$custom_field = get_post_meta($postid, 'thumbnail', true);
if ( has_post_thumbnail($postid) ) {
$featured_img = get_the_post_thumbnail($postid, 'thumbnail');
echo '&lt;div&gt;&lt;a href=&quot;'.get_permalink($postid).'&quot;&gt;'.$featured_img.'&lt;/a&gt;&lt;/div&gt;';
}
elseif ( $custom_field ) {
echo '&lt;div&gt;&lt;a href=&quot;'.get_permalink($postid).'&quot;&gt;&lt;img src=&quot;'.$custom_field.'&quot; /&gt;&lt;/a&gt;&lt;/div&gt;';
}
}
</pre>
<p>And then, in the Loop, where I want the image to appear:</p>
<pre class="brush: php; title: ; notranslate">&lt;?php my_smart_thumbnail(get_the_ID()); ?&gt;</pre>
<p>With that, the old thumbnails keep working, but moving forward the new thumbnails take precedence.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.webmaster-source.com/2012/06/11/wordpress-post-thumbnails-migrating-from-custom-fields-to-the-featured-image-api/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>WordPress 2.9 has Thumbnail Support. What Does This Mean for Existing Themes?</title>
		<link>https://www.webmaster-source.com/2010/04/14/wordpress-2-9-has-thumbnail-support-what-does-this-mean-for-existing-themes/</link>
		<comments>https://www.webmaster-source.com/2010/04/14/wordpress-2-9-has-thumbnail-support-what-does-this-mean-for-existing-themes/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 11:52:52 +0000</pubDate>
		<dc:creator><![CDATA[Matt]]></dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[thumbnails]]></category>

		<guid isPermaLink="false">http://www.webmaster-source.com/?p=3214</guid>
		<description><![CDATA[When WordPress 2.9 came out, one of the touted features was the &#8220;official&#8221; support for post thumbnails. Instead of storing URLs in custom fields, a new method with an easy UI was added. This is great for one major reason: now your thumbnails are less reliant on your theme. If you change your theme, you [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>When WordPress 2.9 came out, one of the touted features was the &#8220;official&#8221; <a href="http://markjaquith.wordpress.com/2009/12/23/new-in-wordpress-2-9-post-thumbnail-images/">support for post thumbnails</a>. Instead of storing URLs in custom fields, a new method with an easy UI was added. This is great for one major reason: now your thumbnails are less reliant on your theme. If you change your theme, you don&#8217;t have to worry about editing it to use the same custom field as your previous theme. Plugins, also, can now easily retrieve post thumbnails, as they don&#8217;t have to guess at your custom field.</p>
<p>Unfortunately, this new feature raises a new problem. <strong>What if you already have an existing, custom field-based, thumbnail solution?</strong> How can you easily (and optimally) move from one to the other?</p>
<p>I have another blog running a plugin called <a href="http://wordpress.org/extend/plugins/wordbooker/">Wordbooker</a>. It automatically syndicates links to my posts on Facebook. It can include the posts&#8217; thumbnails when it does so, but it relies on WP 2.9&#8217;s way of doing things. Facebook &#8220;fans&#8221; won&#8217;t see the nice images by the links unless I were to migrate from custom fields to the new built-in thumbnail feature. How do I do that?</p>
<p>I could update my template to <a href="http://mattbrett.com/2010/01/bulletproof-post-thumbnails-in-wordpress-2-9/">use PHP &#8220;if&#8221; statements to determine which method</a> it should use for each post, and just use the new thumbnails for new post. That seems a little clunky though. Another, cleaner, option would be to have a look at the SQL columns and build a query to create the new thumbnails.</p>
<p>This seems like a great opportunity for a plugin developer. A single-use &#8220;importer&#8221; that reads an inputted custom field and iterates through all of your posts, creating the new thumbnail entries.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.webmaster-source.com/2010/04/14/wordpress-2-9-has-thumbnail-support-what-does-this-mean-for-existing-themes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automated Website Thumbnails via WordPress.com</title>
		<link>https://www.webmaster-source.com/2010/02/16/automated-website-thumbnails-via-wordpress-com/</link>
		<comments>https://www.webmaster-source.com/2010/02/16/automated-website-thumbnails-via-wordpress-com/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 11:30:20 +0000</pubDate>
		<dc:creator><![CDATA[Matt]]></dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[Automattic]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[screenshots]]></category>
		<category><![CDATA[thumbnails]]></category>
		<category><![CDATA[WordPress.com]]></category>

		<guid isPermaLink="false">http://www.webmaster-source.com/?p=3031</guid>
		<description><![CDATA[Ben Gillbanks has unearthed a neat, undocumented API. If you have a look at his WPVote site, you&#8217;ll note that next to each link there is a thumbnail or the originating site. There are several services that can generate thumbnails like that, but most of them place watermarks on the images or place limits on [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Ben Gillbanks has <a href="http://www.binarymoon.co.uk/2010/02/automated-take-screenshots-website-free/">unearthed a neat, undocumented API.</a> If you have a look at his <a href="http://wpvote.com/">WPVote</a> site, you&#8217;ll note that next to each link there is a thumbnail or the originating site.</p>
<p>There are several services that can generate thumbnails like that, but most of them place watermarks on the images or place limits on how many API calls you can make in a month. (Amazon used to offer a paid service, but it was discontinued a year or two ago.)</p>
<p>To my surprise, when I was submitting an article to WPVote recently, I found that the thumbnails were served up by a subdomain of WordPress.com. I thought something along the lines of &#8220;Eh? I didn&#8217;t know they offered a screenshot service&#8230;&#8221; and continued about my business.</p>
<p>A couple days later, I spotted Ben&#8217;s <a href="http://www.binarymoon.co.uk/2010/02/automated-take-screenshots-website-free/">blog post</a> in my feed reader. In it he explained how he discovered a dynamic URL that Automattic uses, in places like the WordPress.org commercial themes page, to display thumbnails. He posted an email to Matt Mullenweg about it and got this as a response:</p>
<blockquote><p>You can use it and link to it, but it&#8217;s not official. It&#8217;s not worth the effort to try to make it into a business &#8211; we have to support it anyway for our own apps.</p></blockquote>
<p>Sounds good to me. <img src="https://www.webmaster-source.com/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /> Obviously it wouldn&#8217;t be nice to use it for something huge and high-traffic, but it seems like they don&#8217;t object to us smaller WordPress fanatics making use of it.</p>
<p><code>http://s.wordpress.com/mshots/v1/http%3A%2F%2Fprothemedesign.com%2F?w=250</code></p>
<p>There&#8217;s now <a href="http://www.binarymoon.co.uk/projects/bm-shots-automated-screenshots-website/">a WordPress plugin</a> that makes it easy to use the thumbnails in blog posts, with a shortcode, or elsewhere with a template tag.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.webmaster-source.com/2010/02/16/automated-website-thumbnails-via-wordpress-com/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Automattic WordPress Post Thumbnails</title>
		<link>https://www.webmaster-source.com/2009/07/27/automattic-wordpress-post-thumbnails/</link>
		<comments>https://www.webmaster-source.com/2009/07/27/automattic-wordpress-post-thumbnails/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 11:49:40 +0000</pubDate>
		<dc:creator><![CDATA[Matt]]></dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[thumbnails]]></category>

		<guid isPermaLink="false">http://www.webmaster-source.com/?p=2400</guid>
		<description><![CDATA[There are plenty of posts floating around the internet about using Custom Fields to assign thumbnail images to individual posts in WordPress. Web Developer Plus has a different idea. Do you often put images in your posts? You probably upload them through the media manager built right in to the WordPress post editor. Every time [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>There are plenty of posts floating around the internet about <a href="http://www.webmaster-source.com/2008/10/30/wordpress-post-thumbnails/">using Custom Fields to assign thumbnail images</a> to individual posts in WordPress. Web Developer Plus has a different idea.</p>
<p>Do you often put images in your posts? You probably upload them through the media manager built right in to the WordPress post editor. Every time you upload an image, it&#8217;s associated with the post you first attach it to. And WordPress creates a thumbnail to go along with it, of the size specified in the media settings.</p>
<p>Web Developer Plus has <a href="http://webdeveloperplus.com/wordpress/how-to-use-thumbnails-generated-by-wordpress-in-your-theme/">a an article on how to automatically find the thumbnail URL</a> of the first image attached to a post and store it in the variable $img, which you can then echo out into an &lt;img /&gt; tag wherever you want the thumbnail to appear.<span id="more-2400"></span></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
//Get images attached to the post
$args = array(
 'post_type' =&gt; 'attachment',
 'post_mime_type' =&gt; 'image',
 'numberposts' =&gt; -1,
 'order' =&gt; 'ASC',
 'post_status' =&gt; null,
 'post_parent' =&gt; $post-&gt;ID
);
$attachments = get_posts($args);
if ($attachments) {
 foreach ($attachments as $attachment) {
 $img = wp_get_attachment_thumb_url( $attachment-&gt;ID );
 break;
 }
}
?&gt;
&lt;img src=&quot;&lt;?php echo $img; ?&gt;&quot; alt=&quot;Post Thumbnail&quot; /&gt;
</pre>
<p>That&#8217;s a bit easier to handle, isn&#8217;t it? Once you have it set up, you don&#8217;t have to mess around with custom fields whenever you write a new post.</p>
<p><a href="http://webdeveloperplus.com/wordpress/how-to-use-thumbnails-generated-by-wordpress-in-your-theme/">How To Use Thumbnails Generated By WordPress In Your Theme</a> [Web Developer Plus]</p>
]]></content:encoded>
			<wfw:commentRss>https://www.webmaster-source.com/2009/07/27/automattic-wordpress-post-thumbnails/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/


Served from: www.webmaster-source.com @ 2026-06-10 03:18:49 by W3 Total Cache
-->