<?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>知更鸟 &#187; 缩略图</title>
	<atom:link href="http://zmingcx.com/tag/%e7%bc%a9%e7%95%a5%e5%9b%be/feed" rel="self" type="application/rss+xml" />
	<link>http://zmingcx.com</link>
	<description>崇尚专注　追求极致</description>
	<lastBuildDate>Mon, 21 May 2012 14:10:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>让WordPress主题随机显示缩略图</title>
		<link>http://zmingcx.com/let-wordpress-theme-randomly-display-thumbnails.html</link>
		<comments>http://zmingcx.com/let-wordpress-theme-randomly-display-thumbnails.html#comments</comments>
		<pubDate>Mon, 08 Mar 2010 14:49:50 +0000</pubDate>
		<dc:creator>知更鸟</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[缩略图]]></category>

		<guid isPermaLink="false">http://zmingcx.com/?p=1939</guid>
		<description><![CDATA[之前本人的新作Hot News主题使用timthumb.php函数自动调整缩略图大小，并生成缓存文件，国外大部分CMS主题也都是采用此方法生成缩略图。但这一方法无法截取外链图片，这一致命弱点最终让我放弃使用timthumb.php函数。目前我使用的新版HotNews pro2.0采用比较普遍的显示缩略图的方法，添加自定义域，并通过CSS控制缩略图大小。有时文章中没有图片，也懒得特意作缩略图，虽然有默认占位图代替缩略图的位置，但文章发多了看着非常单调，也失去了缩略图吸引读者眼球的作用，于是忽随机显示默认缩略图的想法就出来了，下面请看具体的实现方法。 一般 WordPress杂志型主题，都具备缩略图功能，采用的通用缩略图函数代码如下： &#60;?php if ( get_post_meta($post-&#62;ID, 'thumbnail', true) ) : ?&#62;    &#60;?php $image = get_post_meta($post-&#62;ID, 'thumbnail', true); ?&#62;    &#60;a href="&#60;?php the_permalink() ?&#62;" rel="bookmark" title="&#60;?php the_title(); ?&#62;"&#62;&#60;img src="&#60;?php echo $image; ?&#62;" alt="&#60;?php the_title(); ?&#62;"/&#62;&#60;/a&#62;    &#60;?php else: ?&#62;    &#60;a href="&#60;?php the_permalink() ?&#62;" rel="bookmark" title="&#60;?php the_title(); ?&#62;"&#62;&#60;img src="&#60;?php bloginfo('template_directory'); ?&#62;/images/img.jpg" alt="&#60;?php the_title(); ?&#62;" /&#62;&#60;/a&#62;    &#60;?php endif; ?&#62;   只需在默认占位图链接位置添加一句rand()函数就可随机调用特定目录下的多个图片，下面是修改后的： &#60;?php if ( get_post_meta($post-&#62;ID, 'thumbnail', true) ) : ?&#62;    &#60;?php $image = get_post_meta($post-&#62;ID, 'thumbnail', true); ?&#62;    &#60;a href="&#60;?php the_permalink() ?&#62;" rel="bookmark" title="&#60;?php the_title(); ?&#62;"&#62;&#60;img src="&#60;?php echo $image; ?&#62;" alt="&#60;?php the_title(); ?&#62;"/&#62;&#60;/a&#62;    &#60;?php else: ?&#62;    &#60;a href="&#60;?php the_permalink() ?&#62;" rel="bookmark" title="&#60;?php the_title(); ?&#62;"&#62;&#60;img src="&#60;?php bloginfo('template_directory'); ?&#62;/images/random/img&#60;?php echo rand(1,5)?&#62;.jpg" alt="&#60;?php the_title(); ?&#62;" /&#62;&#60;/a&#62;    &#60;?php endif; ?&#62;   修改后的代码说明： /images/random/img&#60;?php echo rand(1,5)?&#62;.jpg   前面的img是图片的名称，我们可以新建几个名称为：img1.jpg, img2.jpg,img3.jpg,img4.jpg,img5.jpg的图片，放到/images/random/（图片所在的位置，可根据实际修改。）目录中，也可以是其它格式的图片，数字5是预设的的随机图片数量，可以修改此数字，并相应增加随机图片数量。将上面的代码添加到模板适当位置，刷新一下页面看看效果如何。 大家可以刷新一下我博客的首页zmingcx.com，看看随机缩略图的实际效果，还是很不错，不过大家要手下留情，刷几下也就算了，呵呵...]]></description>
			<content:encoded><![CDATA[<p>之前本人的新作Hot News主题使用timthumb.php函数自动调整缩略图大小，并生成缓存文件，国外大部分CMS主题也都是采用此方法生成缩略图。但这一方法无法截取外链图片，这一致命弱点最终让我放弃使用timthumb.php函数。目前我使用的新版HotNews pro2.0采用比较普遍的显示缩略图的方法，添加自定义域，并通过CSS控制缩略图大小。有时文章中没有图片，也懒得特意作缩略图，虽然有默认占位图代替缩略图的位置，但文章发多了看着非常单调，也失去了缩略图吸引读者眼球的作用，于是忽随机显示默认缩略图的想法就出来了，下面请看具体的实现方法。<br />
一般 WordPress杂志型主题，都具备缩略图功能，采用的通用缩略图函数代码如下：</p>
<div class="dp-highlighter">
<ol class="dp-c">
<li class="alt"><span><span>&lt;?php </span><span class="keyword">if</span><span> ( get_post_meta(</span><span class="vars">$post</span><span>-&gt;ID, 'thumbnail', true) ) : ?&gt;   </span></span></li>
<li><span>&lt;?php </span><span class="vars">$image</span><span> = get_post_meta(</span><span class="vars">$post</span><span>-&gt;ID, 'thumbnail', true); ?&gt;   </span></li>
<li class="alt"><span>&lt;a href=</span><span class="string">"&lt;?php the_permalink() ?&gt;"</span><span> rel=</span><span class="string">"bookmark"</span><span> title=</span><span class="string">"&lt;?php the_title(); ?&gt;"</span><span>&gt;&lt;img src=</span><span class="string">"&lt;?php echo $image; ?&gt;"</span><span> alt=</span><span class="string">"&lt;?php the_title(); ?&gt;"</span><span>/&gt;&lt;/a&gt;   </span></li>
<li><span>&lt;?php </span><span class="keyword">else</span><span>: ?&gt;   </span></li>
<li class="alt"><span>&lt;a href=</span><span class="string">"&lt;?php the_permalink() ?&gt;"</span><span> rel=</span><span class="string">"bookmark"</span><span> title=</span><span class="string">"&lt;?php the_title(); ?&gt;"</span><span>&gt;&lt;img src=</span><span class="string">"&lt;?php bloginfo('template_directory'); ?&gt;/images/img.jpg"</span><span> alt=</span><span class="string">"&lt;?php the_title(); ?&gt;"</span><span> /&gt;&lt;/a&gt;   </span></li>
<li><span>&lt;?php </span><span class="keyword">endif</span><span>; ?&gt;  </span></li>
</ol>
</div>
<p>只需在默认占位图链接位置添加一句rand()函数就可随机调用特定目录下的多个图片，下面是修改后的：</p>
<div class="dp-highlighter">
<div class="bar"></div>
<ol class="dp-c">
<li class="alt"><span><span>&lt;?php </span><span class="keyword">if</span><span> ( get_post_meta(</span><span class="vars">$post</span><span>-&gt;ID, 'thumbnail', true) ) : ?&gt;   </span></span></li>
<li><span>&lt;?php </span><span class="vars">$image</span><span> = get_post_meta(</span><span class="vars">$post</span><span>-&gt;ID, 'thumbnail', true); ?&gt;   </span></li>
<li class="alt"><span>&lt;a href=</span><span class="string">"&lt;?php the_permalink() ?&gt;"</span><span> rel=</span><span class="string">"bookmark"</span><span> title=</span><span class="string">"&lt;?php the_title(); ?&gt;"</span><span>&gt;&lt;img src=</span><span class="string">"&lt;?php echo $image; ?&gt;"</span><span> alt=</span><span class="string">"&lt;?php the_title(); ?&gt;"</span><span>/&gt;&lt;/a&gt;   </span></li>
<li><span>&lt;?php </span><span class="keyword">else</span><span>: ?&gt;   </span></li>
<li class="alt"><span>&lt;a href=</span><span class="string">"&lt;?php the_permalink() ?&gt;"</span><span> rel=</span><span class="string">"bookmark"</span><span> title=</span><span class="string">"&lt;?php the_title(); ?&gt;"</span><span>&gt;&lt;img src=</span><span class="string">"&lt;?php bloginfo('template_directory'); ?&gt;/images/random/img&lt;?php echo rand(1,5)?&gt;.jpg"</span><span> alt=</span><span class="string">"&lt;?php the_title(); ?&gt;"</span><span> /&gt;&lt;/a&gt;   </span></li>
<li><span>&lt;?php </span><span class="keyword">endif</span><span>; ?&gt;  </span></li>
</ol>
</div>
<p>修改后的代码说明：</p>
<div class="dp-highlighter">
<ol class="dp-c">
<li class="alt"><span><span>/images/random/img&lt;?php </span><span class="func">echo</span><span> rand(1,5)?&gt;.jpg  </span></span></li>
</ol>
</div>
<p>前面的img是图片的名称，我们可以新建几个名称为：img1.jpg, img2.jpg,img3.jpg,img4.jpg,img5.jpg的图片，放到/images/random/（图片所在的位置，可根据实际修改。）目录中，也可以是其它格式的图片，数字5是预设的的随机图片数量，可以修改此数字，并相应增加随机图片数量。将上面的代码添加到模板适当位置，刷新一下页面看看效果如何。<br />
大家可以刷新一下<a href="http://zmingcx.com/">我博客的首页zmingcx.com</a>，看看随机缩略图的实际效果，还是很不错，不过大家要手下留情，刷几下也就算了，呵呵...</p>
]]></content:encoded>
			<wfw:commentRss>http://zmingcx.com/let-wordpress-theme-randomly-display-thumbnails.html/feed</wfw:commentRss>
		<slash:comments>37</slash:comments>
		</item>
		<item>
		<title>国外博客缩略图赏析</title>
		<link>http://zmingcx.com/appreciation-of-foreign-blog-thumbnail.html</link>
		<comments>http://zmingcx.com/appreciation-of-foreign-blog-thumbnail.html#comments</comments>
		<pubDate>Fri, 05 Mar 2010 09:23:04 +0000</pubDate>
		<dc:creator>知更鸟</dc:creator>
				<category><![CDATA[Web前端]]></category>
		<category><![CDATA[缩略图]]></category>

		<guid isPermaLink="false">http://zmingcx.com/?p=1934</guid>
		<description><![CDATA[越来越多的Wordpress主题都具备了缩略图功能，而且此类型的主题也很受欢迎，这一功能给你的博客增添了观赏性。一个没个图片只有文字的页面，很难让人读下去。但如何能让缩略图真正吸引访问者，从而有助于鼓励他们继续探索您的网站，除了自身需要具备一定图形图像软件操纵能力外，还需要非常大胆和独特的创意。欣赏一下国外博客上漂亮的缩略图，可能会给你一些启发。 Examples of Post Thumbnails A very Unique Solution on Tutorial9 Introducing, a true master at making an interesting post thumbnails, Mr David Leggett. In this case a very bold &#38; unique use of the content (icons) to create a memorable thumbnail. Clean and crisp thumbnail on AppStorm A very clean lighting effect in the [...]]]></description>
			<content:encoded><![CDATA[<p>越来越多的Wordpress主题都具备了缩略图功能，而且此类型的主题也很受欢迎，这一功能给你的博客增添了观赏性。一个没个图片只有文字的页面，很难让人读下去。但如何能让缩略图真正吸引访问者，从而有助于鼓励他们继续探索您的网站，除了自身需要具备一定图形图像软件操纵能力外，还需要非常大胆和独特的创意。欣赏一下国外博客上漂亮的缩略图，可能会给你一些启发。</p>
<h4>Examples of Post Thumbnails</h4>
<h3>A very Unique Solution on Tutorial9</h3>
<p>Introducing, a true master at making an interesting post thumbnails, Mr <a title="David Leggett - A fantastic designer of Creative Post  Thumbnails" href="http://www.theleggett.com/">David Leggett</a>. In this case a very bold &amp; unique use of the content (icons) to create a memorable thumbnail.</p>
<p><a href="http://www.tutorial9.net/resources/free-icon-pack-web-injection/"><img title="Post Thumbnails: Good Examples - Tutorial9" src="http://www.wefunction.com/wp-content/uploads/2009/09/intro_1.jpg" alt="" width="490" height="360" /></a></p>
<h3>Clean and crisp thumbnail on AppStorm</h3>
<p>A very clean lighting effect in the background with a modern font &amp; great colors to catch attention. Notice the 1pixel white drop shadow on the word “interview” - a simple &amp; effective approach.</p>
<p><a href="http://mac.appstorm.net/general/interview-with-founders-of-envato-collis-and-cyan/"><img title="Post Thumbnails: Good examples - AppStorm" src="http://www.wefunction.com/wp-content/uploads/2009/09/intro_7.jpg" alt="" width="490" height="360" /></a></p>
<h3>Keeping your Photographs Relevant (UX Booth)</h3>
<p>Another fantastic example from <a title="David Leggett of Tutorial 8" href="http://www.tutorial9.net/">David Leggett</a>. This time he’s not relied on his skill in Photoshop, he’s simply relied on that old favorite the photograph. A good looking, and relevant photo perfects your content perfectly.</p>
<p><a href="http://www.uxbooth.com/blog/tabbed-navigation-and-what-makes-it-useful/"><img title="Post Thumbnails: Good examples - UxBooth" src="http://www.wefunction.com/wp-content/uploads/2009/09/intro_3.jpg" alt="" width="490" height="360" /></a></p>
<h3>Clever use of Screenshots on Obox</h3>
<p>This example by Obox shows how placement of the elements on the thumbnail can generate interest. You get a sneak peak at the content with some cleverly placed screenshots with a good background lighting effect and the all important text which looks fantastic and the contrast is perfect.</p>
<p><a href="http://www.wearenotfreelancers.co.za/view_item.cfm/title/two_new_themes_and_ones_free"><img title="Post Thumbnails: Good examples - We Are Not  Freelancers" src="http://www.wefunction.com/wp-content/uploads/2009/09/intro_15.jpg" alt="" /></a></p>
<h3>Picking the Perfect Image, Courtesy of DesignShard</h3>
<p>Again, Keeping your image relevant is a must. And in this example another photo, but it has 3 things: simplicity, visual impact and relevance.</p>
<p><a href="http://www.designshard.com/web-design/get-more-traffic-with-good-design/"><img title="Post Thumbnails: Good examples - Design Shard" src="http://www.wefunction.com/wp-content/uploads/2009/09/intro_2.jpg" alt="" width="490" height="360" /></a></p>
<h3>OutlawDesign Makes the Thumbnails Part of the Design</h3>
<p>Two great examples on <a title="OutlawDesignBlog" href="http://outlawdesignblog.com/">Outlaw Design Blog</a>. We see a stunning Photograph on one, and on the other one of the logo’s from inside the post has been chosen for the thumbnail, a great visual impact.</p>
<p>You can also start to see how the <em>blog design benefits from showcasing <strong>multiple</strong> good looking thumbnails</em>. The post thumbnails really become part of the design in this case.</p>
<p><a href="http://www.outlawdesignblog.com/"><img title="Post Thumbnails: Good examples - OutlawDesignBlog" src="http://www.wefunction.com/wp-content/uploads/2009/09/intro_5.jpg" alt="" width="490" height="360" /></a></p>
<h3>UxBooth again with Text Over Photographs</h3>
<p>Using fantastic looking text on top of some really appealing images can be a real hit. This is a great example of strong typographic elements on top of a crisp &amp; relevant photograph.</p>
<p><a href="http://www.uxbooth.com/"><img title="Post  Thumbnails: Good examples - UXBooth" src="http://www.wefunction.com/wp-content/uploads/2009/09/intro_4.jpg" alt="" width="490" height="360" /><br />
</a></p>
<h3>WebDesignLedger Improve Exploration</h3>
<p>Apart from looking great, a relevant &amp; good looking thumbnail can help visitors navigate through your posts. This is particularly important if you have a lot of posts on your blog or site.</p>
<p><a href="http://webdesignledger.com/"><img title="Post Thumbnails: Good examples - Web Design Ledger" src="http://wefunction.com/wp-content/uploads/2009/09/intro_6.jpg" alt="" width="490" height="360" /></a></p>
<p style="text-align: center;">继续阅读下页</p>
<p>&nbsp;</p>
<h3>WebDesignerDepot Keep it Simple &amp; Effective</h3>
<p>If you are lucky enough to be writing about something that includes a lot of great looking content, show off this content. It’s not just a quick solution but a very effective one, and again it would help people who are scanning your content understand what the post includes.</p>
<p><a href="http://www.webdesignerdepot.com/2009/07/50-eye-popping-examples-of-concept-art/"><img title="Post Thumbnails: Good examples - Web Designer  Depot" src="http://wefunction.com/wp-content/uploads/2009/09/intro_8.jpg" alt="" width="490" height="360" /></a></p>
<h3>Fubiz Lets the Image do the Talking</h3>
<p><strong>Layout</strong> can play a big part in the effectiveness of your thumbnails. This example uses quite a large image with a simple line of text. For me these are very useful, especially when the image is very pretty!</p>
<p><a href="http://www.fubiz.net/"><img title="Post  Thumbnails: Good examples - Fubiz" src="http://wefunction.com/wp-content/uploads/2009/09/intro_9.jpg" alt="" width="490" height="360" /><br />
</a></p>
<h3>Fubiz does more with their Thumbnails</h3>
<p>Having such interesting post thumbnails gives you the chance to experiment with alternative ways of navigating content, like this fantastic gallery view on <a title="Fubiz" href="http://fubiz.net/">Fubiz</a>.</p>
<p><a href="http://www.fubiz.net/"><img title="Post  Thumbnails: Good examples - Fubiz Gallery" src="http://wefunction.com/wp-content/uploads/2009/09/intro_10.jpg" alt="" width="490" height="360" /></a></p>
<h3>Build Internet combine Photography &amp; Text</h3>
<p>Text on the top of a photo once again, just another example of how this can work so very well. Remember our <a title="Quality within Web  Design Tips" href="http://wefunction.com/2009/04/quality-within-web-design/">quality</a> tips too when putting together any graphics.</p>
<p><a href="http://buildinternet.com/2009/07/the-rebranding-of-a-company-a-case-study/"><img title="Post Thumbnails: Good examples - Build  Internet" src="http://wefunction.com/wp-content/uploads/2009/09/intro_11.jpg" alt="" width="490" height="360" /></a></p>
<h3>Good Thumbnail Positioning on PSDTuts</h3>
<p>The layout of your thumbnails is important. This style (which I first saw used across the Envato sites) seems to be very popular with bloggers.</p>
<p><a href="http://psd.tutsplus.com/"><img title="Post  Thumbnails: Good examples - PSD Tuts" src="http://wefunction.com/wp-content/uploads/2009/09/intro_12.jpg" alt="" width="490" height="360" /><br />
</a></p>
<h3>WebDesignerWall Uses CSS to Style Thumbnails</h3>
<p>A Simple use of a gradient &amp; some nice typography. What I like about Web Designer Wall is that each of their thumbnails has the white edge with a gray border, it gives your images a bit of consistency and having a default style on images can make them fit in with your site a lot better.</p>
<p><a href="http://www.webdesignerwall.com/"><img title="Post Thumbnails: Good examples - Web Designer Wall" src="http://wefunction.com/wp-content/uploads/2009/09/intro_13.jpg" alt="" width="490" height="360" /></a></p>
<h3>Imeem have also styled their Thumbnail Border</h3>
<p>Every thumbnail on the <a title="imeem" href="http://imeem.com/">imeem</a> website looks like it’s almost a photo sitting on top of the page. There actual photo <strong>does not</strong> have this effect on it, the <strong>frame around the image</strong> has been made &amp; just sits behind, this makes your thumbnail look as if it’s it’s part of the frame, but really it’s all separate.</p>
<p>It’s a easy way of styling multiple images and leaves you open to change the style of the border, when you update your web design.</p>
<p><a href="http://www.imeem.com/"><img title="Post  Thumbnails: Good examples - Imeem" src="http://wefunction.com/wp-content/uploads/2009/09/intro_18.jpg" alt="" width="490" height="360" /></a><a href="http://www.webdesignerwall.com/"><br />
</a></p>
<h4>Methods of Making Creative Thumbnails</h4>
<p><strong>Summing up your post into one image</strong>, and making it look attractive is a big part of catching the interest of readers who are exploring your homepage. It has also become more common to see thumbnails next to blog title on a homepage, rather than just text. Layout of the image is important too, finding the perfect place to put your image is an art in itself. Sometimes a full image is used, sometimes a small thumbnail, anything from a photo to a sketch or full vector illustration, the ability to create so <strong>many different</strong> things should be your biggest advantage!</p>
<p>You have a <strong>fresh canvas with each blog post</strong>, you don’t need to keep constancy with your thumbnails &amp; post images, each one can be a new work of art, a chance to express yourself and a chance to back up what you are writing with your creativity.</p>
<p>There are a variety of ways capturing &amp; creating the perfect thumbnail for your post, but it’s important that the image <strong>compliments the post</strong>, keeps relevant and isn’t too complicated - we’re going to explain a select few examples in further detail now.</p>
<h4>Unique &amp; Custom Graphics</h4>
<p>Without doubt this would be the most time consuming way of creating good looking thumbnail/introduction images for your post, but as you will see it’s clearly worth the time when you get it right. This process would involve looking at the post as a product, and the post thumbnail as an advert for that product, you need to find creative ways to best showcase that product, using a mix of various design methods.</p>
<h3>A closer Look at Tutoria9’s Unique &amp; Bold Style</h3>
<p><a title="David Leggett - A fantastic designer of Creative Post  Thumbnails" href="http://www.theleggett.com/">David Leggett</a>, the fantastic designer behind <a title="Tutorial9 - Top Quality Tutorials" href="http://www.tutorial9.net/">Tutorial9</a> has included some important techniques to style his thumbnail, a nicely executed <em>drop shadow</em>, a background <em>lighting effect</em> that helps to build depth, and also some <em>blur</em> is applied on some elements to also build depth and give the image something different visually. David has also kept some basic ideas in mind, such as <strong>contrast</strong> (light on dark) and he’s included a tag-line.</p>
<p>I think this example is a <strong>great use of space</strong>, and the fact David has made his image posts such a big feature on his site gives him room to experiment &amp; create something outstanding each time. Have a think about what you can take from this and apply to your next blog thumbnail, remember to keep <a title="How to Spot Quality in  Web Design" href="http://wefunction.com/2009/04/quality-within-web-design/">Quality</a> in mind.</p>
<p><a href="http://www.tutorial9.net/resources/free-icon-pack-web-injection/"><img title="Grabbing Attention  with Post Thumbnails: Tutorial9" src="http://www.wefunction.com/wp-content/uploads/2009/09/intro_14.jpg" alt="" width="490" height="360" /></a></p>
<p style="text-align: center;">继续阅读下页</p>
<p>?</p>
]]></content:encoded>
			<wfw:commentRss>http://zmingcx.com/appreciation-of-foreign-blog-thumbnail.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

