<?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>Tweeaks Design &#187; Themes</title>
	<atom:link href="http://tweeaks.com/category/wordpress/themes/feed/" rel="self" type="application/rss+xml" />
	<link>http://tweeaks.com</link>
	<description>more than just eye popping designs</description>
	<lastBuildDate>Sat, 12 Jun 2010 10:04:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>WordPress Custom Fields: Add Excerpts And Post Thumbnails To Theme</title>
		<link>http://tweeaks.com/wordpress/wordpress-custom-fields-add-excerpts-and-post-thumbnails-to-theme/</link>
		<comments>http://tweeaks.com/wordpress/wordpress-custom-fields-add-excerpts-and-post-thumbnails-to-theme/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 04:51:22 +0000</pubDate>
		<dc:creator>jaredwilli</dc:creator>
				<category><![CDATA[Themes]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Custom Fields]]></category>
		<category><![CDATA[Excerpts]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://tweeaks.com/?p=3140</guid>
		<description><![CDATA[<a href="/wordpress/wordpress-custom-fields-add-excerpts-and-post-thumbnails-to-theme/"><img class="alignright size-full wp-image-1652" title="wordpress-hacks" src="http://tweeaks.com/wp-content/uploads/2009/09/wordpress-hacks.jpg" alt="wordpress-hacks" height="144" width="144"></a>One thing thing I would like to implement here that I have included in the new theme I'm making is post thumbnails. If you haven't noticed the <a href="/">index page</a> of this site has a post thumbnail but it isn't displayed using custom fields. In this post I will show you how you can add post thumbnails with excerpts to your Wordpress theme]]></description>
			<content:encoded><![CDATA[<p><a href="http://tweeaks.com/wordpress/wordpress-custom-fields-add-excerpts-and-post-thumbnails-to-theme/"><img class="alignright size-full wp-image-1652" title="wordpress-hacks" src="http://tweeaks.com/wp-content/uploads/2009/09/wordpress-hacks.jpg" alt="wordpress-hacks" height="144" width="144"></a>I have been working on <a href="http://tweeaks.com/wordpress/a-fresh-new-wordpress-theme-design-by-tweeaks/">making a new theme</a> lately, and since it is the first WordPress theme I&#8217;ve made from scratch, design to development, I&#8217;ve been trying to incorporate a number of features that I wish this website&#8217;s theme had. I could easily hack this site&#8217;s theme up and add anything to it, but I&#8217;ve learned it would be far more easy to build a new theme from scratch, after hacking the free theme this site started out with up into pieces, and making the code a huge mess.</p>
<p>One thing thing I would like to implement here that I have included in the new theme I&#8217;m making is post thumbnails. If you haven&#8217;t noticed the <a href="http://tweeaks.com/">index page</a> of this site has a post thumbnail but it isn&#8217;t displayed using custom fields. I simply include the image html code in the Excerpt field along with the post description. The post excerpt is all that shows. </p>
<p>I talked about how to use <a href="http://tweeaks.com/wordpress/how-to-using-wordpress-excerpts/">excerpts in your theme</a> here, and wanted to Using the excerpt to display just the post description, and custom fields to display the post thumbnail, you can have more control over the appearance, and it&#8217;s just a better way to do it. </p>
<h2>Adding excerpts with thumbnails to your theme</h2>
<p>In your WP admin on the post write page you will see the Custom Fields box. You may have to expand it if it is collapsed, but it looks like this.</p>
<p><img src="http://tweeaks.com/wp-content/uploads/2010/01/customfields.png" alt="" title="customfields"  class="aligncenter size-thumbnail wp-image-3141" /></p>
<p>For adding post thumbnails, you can just upload an image the way you normally would add images to your posts by clicking <img src="http://tweeaks.com/wp-admin/images/media-button-image.gif" /> above the post panel then copy the image url and paste it in the Value textarea of the custom fields, and set the Name to Thumbnail.</p>
<p>You will need to edit the index.php template of your theme. If you want to show the post excerpt with the thumbnail image on your blog homepage you will need to add the the code to show excerpts and to get and display the custom fields. First find the code <strong>the_content();</strong> in your index.php file, and replace it with this.</p>
<div class="codecolorer-container php dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">the_excerpt<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Read the rest of this entry &amp;raquo;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>This will show the post excerpt instead of the whole post.</p>
<p>Below that add this code.</p>
<div class="codecolorer-container php dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #b1b100;">echo</span> get_post_meta<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Thumbnail&quot;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>The get_post_meta() function gets the value of the custom field that has the name &#8220;Thumbnail&#8221;. For more information on the usage of this and other functions that have to do with custom fields, you can find it <a href="http://codex.wordpress.org/Custom_Fields">here on WordPress.org</a>.</p>
<p>You can do this for many other things too besides images. Imagine the possibilities!!</p>
<h3>Entire Code</h3>
<p>This is the code I used in index template for the new theme I&#8217;m making, including the HTML.</p>
<div class="codecolorer-container php dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;div class=&quot;excerpt&quot;&gt;<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_excerpt<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Read the rest of this entry &amp;raquo;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><br />
&lt;/div&gt;<br />
&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<br />
&nbsp; &lt;img src=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_post_meta<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Thumbnail&quot;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; alt=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; title=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; /&gt;<br />
&lt;/a&gt;</div></td></tr></tbody></table></div>
<p><strong>Here is the CSS I used for styling it.</strong></p>
<div class="codecolorer-container css dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6666ff;">.post</span> <span style="color: #6666ff;">.excerpt</span> <span style="color: #00AA00;">&#123;</span> <br />
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">325px</span><span style="color: #00AA00;">;</span> <br />
<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <br />
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">20px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <br />
<span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div>
<p>With this you should be able to make a nice looking index page complete with excerpts and post thumbnails. If you have any questions let me know.</p>
<h2>UPDATE</h2>
<p><strong>Here is my updated code which will show a default image if you do no have a post thumbnail defined in your post custom fields.</strong></p>
<div class="codecolorer-container php dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$thumbnail</span> <span style="color: #339933;">=</span> get_post_meta<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'thumbnail'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$thumbnail</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><br />
&nbsp; &lt;img src=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_post_meta<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;thumbnail&quot;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; alt=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; title=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; /&gt;<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><br />
&nbsp; &lt;img src=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_directory'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/default.jpg&quot; alt=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; title=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; /&gt;<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></div></td></tr></tbody></table></div>
<p>You can also learn how to set up category thumbnails and how to show them as your post thumbnails instead from a <a href="http://new2wp.com/pro/2.5-ways-to-show-category-thumbnails">post I wrote on New2WP.com here</a> as well.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://tweeaks.com/wordpress/how-to-using-wordpress-excerpts/" rel="bookmark" class="crp_title">How To Use WordPress Excerpts On Your Blog Homepage</a></li><li><a href="http://tweeaks.com/coding/create-a-random-banner-ad-rotator-in-php/" rel="bookmark" class="crp_title">Create A Random Banner Ad Rotator in PHP</a></li><li><a href="http://tweeaks.com/coding/jquery/how-to-make-a-dynamic-jquery-feature-post-slider-for-wordpress/" rel="bookmark" class="crp_title">How To Make A Dynamic jQuery Feature Post Slider For WordPress</a></li><li><a href="http://tweeaks.com/wordpress/a-fresh-new-wordpress-theme-design-by-tweeaks/" rel="bookmark" class="crp_title">A Fresh New WordPress Theme Design By Tweeaks</a></li><li><a href="http://tweeaks.com/wordpress/10-extremely-useful-wordpress-hacks-and-tips/" rel="bookmark" class="crp_title">10 Extremely Useful WordPress Hacks</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://tweeaks.com/wordpress/wordpress-custom-fields-add-excerpts-and-post-thumbnails-to-theme/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>A Fresh New WordPress Theme Design By Tweeaks</title>
		<link>http://tweeaks.com/wordpress/a-fresh-new-wordpress-theme-design-by-tweeaks/</link>
		<comments>http://tweeaks.com/wordpress/a-fresh-new-wordpress-theme-design-by-tweeaks/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 08:09:55 +0000</pubDate>
		<dc:creator>jaredwilli</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Themes]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Dark]]></category>
		<category><![CDATA[Design]]></category>

		<guid isPermaLink="false">http://tweeaks.com/?p=3046</guid>
		<description><![CDATA[<a rel="attachment wp-att-3045" href="http://tweeaks.com/wordpress/a-fresh-new-wordpress-theme-design-by-tweeaks/"><img class="alignright size-thumbnail wp-image-3045" title="New2WP_Theme_preview" src="http://tweeaks.com/wp-content/uploads/2010/01/New2WP_Theme_preview-200x200.png" alt="" width="200" height="200" /></a>This is a new project I am working on, and it's about time too! I have been meaning to start making Wordpress custom themes and designs for a while now, and never had the time to with all the other things I have going on. I had a reason to do it this time, and was motivated to make it the best I could, but within some requirements]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-3045" href="http://tweeaks.com/wordpress/a-fresh-new-wordpress-theme-design-by-tweeaks/attachment/new2wp_theme_preview/"><img class="alignright size-thumbnail wp-image-3045" title="New2WP_Theme_preview" src="http://tweeaks.com/wp-content/uploads/2010/01/New2WP_Theme_preview-200x200.png" alt="" width="200" height="200" /></a>This is a new project I am working on, and it&#8217;s about time too! I have been meaning to start making WordPress custom themes and designs for a while now, and never had the time to with all the other things I have going on. I had a reason to do it this time, and was motivated to make it the best I could, but within some requirements.</p>
<p>The site I am designing this for is <a href="http://new2wp.com" target="_blank">New2WP.com</a>, which is owned by my friend <a href="http://afj176.com/">Antonio</a>, a Web Developer and WordPress guru. We are combining forces to bring this site together. Between my design knowledge and his development knowledge, you can be sure this will be a fantastic combination. If you are interested in learning WordPress and all that it has to offer, or just love awesome websites then <a href="http://new2wp.com/?feed=rss2" target="_blank">subscribe to the RSS feed</a> to stay updated on the launch of the site and all the future news and information we will bring you.</p>
<p>There is just so much you can do using <a href="http://wordpress.org">WordPress</a> and it&#8217;s very flexible and easy to work with even for people with no knowledge of PHP or blogging software. Most people who have a WordPress blog don&#8217;t utilize it to its full capabilities. We want to help change that, and show you that it&#8217;s not only simple to do, but that it takes no time at all to do it.</p>
<p><strong>Here is a view of the entire home page design.<br />
</strong></p>
<p style="text-align: center;"><a href="http://tweeaks.com/wp-content/uploads/2010/01/New2WP_Theme_2.2.png" target="_blank"><img class="double-border aligncenter" src="http://behance.vo.llnwd.net/profiles2/139045/projects/384083/1390451263019460.png" alt="Custom WordPress Theme by Tweeaks" /></a></p>
<p style="text-align: left;"><strong>Here is the posts page layout<br />
</strong></p>
<p style="text-align: center;">
<p style="text-align: center;"><a href="http://tweeaks.com/wp-content/uploads/2010/01/New2WP_Theme_POST-SINGLE.png" target="_blank"><img class="double-border aligncenter" src="http://behance.vo.llnwd.net/profiles2/139045/projects/384083/1390451263145823.png" alt="Custom WordPress Theme by Tweeaks" /></a></p>
<p style="text-align: left;">If you have any feedback about this theme please post a comment and tell me what you think. It is my first theme, and definitely not the last.</p>
<p>Don&#8217;t forget to check out New2WP.com and see this theme in action once it is live!!</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://tweeaks.com/wordpress/27th-birthday-post-with-7-of-my-favorite-wordpress-design-and-development-blogs/" rel="bookmark" class="crp_title">Forever 27: My Birthday Post With 7 Favorite WordPress Design And Development Blogs</a></li><li><a href="http://tweeaks.com/resources/resources-ps/create-a-professional-looking-house-icon-in-photoshop/" rel="bookmark" class="crp_title">Create A Professional Looking House Icon In Photoshop</a></li><li><a href="http://tweeaks.com/resources/amazing-c4d-render-packs-for-photoshop/" rel="bookmark" class="crp_title">5 Amazing C4D Render Packs For Photoshop</a></li><li><a href="http://tweeaks.com/wordpress/wordpress-custom-fields-add-excerpts-and-post-thumbnails-to-theme/" rel="bookmark" class="crp_title">WordPress Custom Fields: Add Excerpts And Post Thumbnails To Theme</a></li><li><a href="http://tweeaks.com/wordpress/free-wordpress-themes/" rel="bookmark" class="crp_title">16 Sites with Quality FREE WordPress Themes</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://tweeaks.com/wordpress/a-fresh-new-wordpress-theme-design-by-tweeaks/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
