<?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>Jared Heinrichs &#187; Wordpress</title>
	<atom:link href="http://jaredheinrichs.com/category/web-applications/wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://jaredheinrichs.com</link>
	<description>A Winnipeg &#34;How to&#34; Blog on Software and Technology</description>
	<lastBuildDate>Thu, 09 Feb 2012 15:35:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Fix WordPress Network WP-DBManager Error Warning: Your backup folder MIGHT be visible to the public</title>
		<link>http://jaredheinrichs.com/fix-wordpress-network-wp-dbmanager-error-warning-your-backup-folder-might-be-visible-to-the-public.html</link>
		<comments>http://jaredheinrichs.com/fix-wordpress-network-wp-dbmanager-error-warning-your-backup-folder-might-be-visible-to-the-public.html#comments</comments>
		<pubDate>Sat, 08 Oct 2011 16:14:59 +0000</pubDate>
		<dc:creator>Jared Heinrichs</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://jaredheinrichs.com/fix-wordpress-network-wp-dbmanager-error-warning-your-backup-folder-might-be-visible-to-the-public.html</guid>
		<description><![CDATA[Are you getting the WordPress WP-DBManager Error – “Your backup folder MIGHT be visible to the public”? Background I was getting this error when I first installed the plugin. I then moved the .htaccess file in the proper location and &#8230; <a href="http://jaredheinrichs.com/fix-wordpress-network-wp-dbmanager-error-warning-your-backup-folder-might-be-visible-to-the-public.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Are you getting the WordPress WP-DBManager Error – “Your backup folder MIGHT be visible to the public”? </p>
<h3>Background</h3>
<p>I was getting this error when I first installed the plugin. I then moved the .htaccess file in the proper location and everything seemed to be working. I then enabled WordPress Networks (Formally called Multisite).&#160; I started getting that error again from WP-DBManager about being being visible to the public.</p>
<h3>Solution</h3>
<p>It turns out that in order to remove the error message happens because wordpress uses virtual directories. Because the .htaccess file isn’t in the virtual directory it put’s up the error. To get around this you need to disable WP-DBManager for the network. Once disabled go to the main WordPress site and enable the plugin there. Do NOT enable the plugin on sub-networks. Voila! You’re done.</p>
]]></content:encoded>
			<wfw:commentRss>http://jaredheinrichs.com/fix-wordpress-network-wp-dbmanager-error-warning-your-backup-folder-might-be-visible-to-the-public.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to remove related youTube videos</title>
		<link>http://jaredheinrichs.com/how-to-remove-related-youtube-videos.html</link>
		<comments>http://jaredheinrichs.com/how-to-remove-related-youtube-videos.html#comments</comments>
		<pubDate>Sat, 08 Oct 2011 13:20:17 +0000</pubDate>
		<dc:creator>Jared Heinrichs</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://jaredheinrichs.com/how-to-remove-related-youtube-videos.html</guid>
		<description><![CDATA[I just started working on my new Winnipeg Photographer Website. I embedded a video but was shocked to see a bunch of my other personal videos were being offered up to people that went to go view the website. Here’s &#8230; <a href="http://jaredheinrichs.com/how-to-remove-related-youtube-videos.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I just started working on my new <a href="http://jaredheinrichsphotography.com/" target="_blank">Winnipeg Photographer</a> Website. I embedded a video but was shocked to see a bunch of my other personal videos were being offered up to people that went to go view the website. Here’s what the related videos look like.</p>
<p><a href="http://jaredheinrichs.com/wp-content/uploads/2011/10/image3.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://jaredheinrichs.com/wp-content/uploads/2011/10/image_thumb3.png" width="428" height="354" /></a></p>
<p>Removing the related videos isn’t all that hard to do. You can only remove the related videos on videos that are embedded&#160; in other webpages. You need to add “&amp;rel=0” to the “src” link. </p>
<p><a href="http://jaredheinrichs.com/wp-content/uploads/2011/10/image4.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://jaredheinrichs.com/wp-content/uploads/2011/10/image_thumb4.png" width="617" height="70" /></a></p>
<p>After making the adjustments here’s what it looks like.</p>
<p><a href="http://jaredheinrichs.com/wp-content/uploads/2011/10/image5.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://jaredheinrichs.com/wp-content/uploads/2011/10/image_thumb5.png" width="433" height="356" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://jaredheinrichs.com/how-to-remove-related-youtube-videos.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to easily backup your WordPress Website</title>
		<link>http://jaredheinrichs.com/how-to-easily-backup-your-wordpress-website.html</link>
		<comments>http://jaredheinrichs.com/how-to-easily-backup-your-wordpress-website.html#comments</comments>
		<pubDate>Sat, 08 Oct 2011 04:16:20 +0000</pubDate>
		<dc:creator>Jared Heinrichs</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://jaredheinrichs.com/how-to-easily-backup-your-wordpress-website.html</guid>
		<description><![CDATA[There are many different ways of backing up your website. I will list here how I setup my backup strategy and why I decided on this solution. Overview – The backup will use WP-DBManager to backup the sql first. I &#8230; <a href="http://jaredheinrichs.com/how-to-easily-backup-your-wordpress-website.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There are many different ways of backing up your website. I will list here how I setup my backup strategy and why I decided on this solution.</p>
<p>Overview – The backup will use WP-DBManager to backup the sql first. I will then use my computer to sync the website to my local PC.</p>
<p>Things needed – You will need a Windows PC, <a href="http://www.educ.umu.se/~cobian/index.htm" target="_blank">Cobain Backup</a> and <a href="http://wordpress.org/extend/plugins/wp-dbmanager/">WP-DBManager</a>.</p>
<p>First log into your WordPress install. You will need to go to the plugins and install “WP-DBmanager”. You will also need to setup the backup. It’s pretty easy to do. If you are installing it on GoDaddy servers make sure to check out my other post &#8211; <a title="http://jaredheinrichs.com/how-setup-wp-dbmanager-with-godaddy-mysqldump-and-mysql.html" href="http://jaredheinrichs.com/how-setup-wp-dbmanager-with-godaddy-mysqldump-and-mysql.html" target="_blank">http://jaredheinrichs.com/how-setup-wp-dbmanager-with-godaddy-mysqldump-and-mysql.html</a></p>
<p>Once done make a backup of the sql database.</p>
<p>Install Cobain Backup on your locally on your PC. Make sure to setup a Task where the source is an FTP site and the destination is your local machine.</p>
<p><a href="http://jaredheinrichs.com/wp-content/uploads/2011/10/image2.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="How to Backup WordPress" border="0" alt="How to Backup WordPress" src="http://jaredheinrichs.com/wp-content/uploads/2011/10/image_thumb2.png" width="518" height="353" /></a></p>
<p>Sync the task You local folder will now not only have everything on the Webserver it will also have the DB Backup. Hope this helps</p>
]]></content:encoded>
			<wfw:commentRss>http://jaredheinrichs.com/how-to-easily-backup-your-wordpress-website.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How setup WP-DBManager with Godaddy (mysqldump and mysql)</title>
		<link>http://jaredheinrichs.com/how-setup-wp-dbmanager-with-godaddy-mysqldump-and-mysql.html</link>
		<comments>http://jaredheinrichs.com/how-setup-wp-dbmanager-with-godaddy-mysqldump-and-mysql.html#comments</comments>
		<pubDate>Sat, 08 Oct 2011 03:59:42 +0000</pubDate>
		<dc:creator>Jared Heinrichs</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://jaredheinrichs.com/how-setup-wp-dbmanager-with-godaddy-mysqldump-and-mysql.html</guid>
		<description><![CDATA[I had a bit of a tough time with this one. When setting up WP-DBPManger in a WordPress install on GoDaddy you will need to use different paths then what most of the forums are saying. The autodect feature in &#8230; <a href="http://jaredheinrichs.com/how-setup-wp-dbmanager-with-godaddy-mysqldump-and-mysql.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I had a bit of a tough time with this one. When setting up WP-DBPManger in a WordPress install on GoDaddy you will need to use different paths then what most of the forums are saying. The autodect feature in WP-DBManager does not work either when the provider is GoDaddy.</p>
<p>To get things working you will need to enter this info:</p>
<p><a href="http://jaredheinrichs.com/wp-content/uploads/2011/10/image1.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://jaredheinrichs.com/wp-content/uploads/2011/10/image_thumb1.png" width="531" height="270" /></a></p>
<p>If you don’t have this info entered you will see red errors all over the place and the backup will not work properly.</p>
<p>Hope this helps anyone trying to setup WP-DBManager on GoDaddy!</p>
]]></content:encoded>
			<wfw:commentRss>http://jaredheinrichs.com/how-setup-wp-dbmanager-with-godaddy-mysqldump-and-mysql.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress  &#8211; How to use WordPress settings in your theme</title>
		<link>http://jaredheinrichs.com/wordpress-how-to-use-wordpress-settings-in-your-theme.html</link>
		<comments>http://jaredheinrichs.com/wordpress-how-to-use-wordpress-settings-in-your-theme.html#comments</comments>
		<pubDate>Tue, 27 Sep 2011 17:14:42 +0000</pubDate>
		<dc:creator>Jared Heinrichs</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://jaredheinrichs.com/wordpress-how-to-use-wordpress-settings-in-your-theme.html</guid>
		<description><![CDATA[One of the most powerful WordPress functions you will get to use is: bloginfo(). You can most likely tell that&#160; WordPress’s bloginfo() function will return some information regarding your blog. I’ve listed all of the command you can feed bloginfo() &#8230; <a href="http://jaredheinrichs.com/wordpress-how-to-use-wordpress-settings-in-your-theme.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One of the most powerful WordPress functions you will get to use is: bloginfo().</p>
<p>You can most likely tell that&#160; WordPress’s bloginfo() function will return some information regarding your blog. I’ve listed all of the command you can feed bloginfo() below.</p>
<p>&#160;</p>
<pre><font size="2">name                 = Testpilot
description          = Just another WordPress blog
admin_email          = admin@example

url                  = http://example/home
wpurl                = http://example/home/wp

stylesheet_directory = http://example/home/wp/wp-content/themes/child-theme
stylesheet_url       = http://example/home/wp/wp-content/themes/child-theme/style.css
template_directory   = http://example/home/wp/wp-content/themes/parent-theme
template_url         = http://example/home/wp/wp-content/themes/parent-theme

atom_url             = http://example/home/feed/atom
rss2_url             = http://example/home/feed
rss_url              = http://example/home/feed/rss
pingback_url         = http://example/home/wp/xmlrpc.php
rdf_url              = http://example/home/feed/rdf

comments_atom_url    = http://example/home/comments/feed/atom
comments_rss2_url    = http://example/home/comments/feed

charset              = UTF-8
html_type            = text/html
language             = en-US
text_direction       = ltr
version              = 3.1</font></pre>
<p>I’m guessing since you are here you are wondering how can you use bloginfo() in your theme and why should you care?</p>
<p>The thing I tend to use bloginfo() for is making sure that no matter where on the site, things like my CSS file location, my home page and theme files are always calculated properly. One of the things I see most often with new WordPress users is that they use relative paths to files like CSS and images. While this might work in static sites, it doesn’t really work all that well in dynamically creates site like a WordPress Website.</p>
<p>Here’s an example:</p>
<p><a href="http://jaredheinrichs.com/wp-content/uploads/2011/09/image32.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://jaredheinrichs.com/wp-content/uploads/2011/09/image_thumb.png" width="361" height="227" /></a></p>
<p>Notice how I highlighted that the url has several sub folders – “/category/operating-system/active-directory-2003”. If your theme would have used relative paths for the logo and the encompassing link you would have noticed that the logo wouldn’t show up and then link would be most likely broken.</p>
<p>What I normally see people do to fix this issue is just put in Fully Qualified Paths for things like the logo and certain links. In my opinion not only does this add extra bloat to the website it also kind of defeats the dynamic nature of WordPress! Because I tend to create offline themes first and then move it to a online Webserver. If you didn’t use bloginfo() for the links you will have to do a bunch of extra manual changes where ever you hard coded things. This causes extra headaches and unneeded work.</p>
<p>Using my website as an example you can see I use bloginfo() to fill in the anchor link “Url”very easily. I’ve also told it display the Logo image that is located in the template directory.</p>
<p><a href="http://jaredheinrichs.com/wp-content/uploads/2011/09/image33.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://jaredheinrichs.com/wp-content/uploads/2011/09/image_thumb1.png" width="697" height="85" /></a></p>
<p>Another thing I have seen is a person is wanting to make a slightly modified theme for say Christmas. If you were to copy the theme, rename the folder and activate then new theme,&#160; all your hard coded links would no longer work or still point to the old theme location!</p>
<p>I recommend getting into a habit of making your themes with built in WordPress functions like bloginfo(). It will save you time and fustration. You will also know that you can pickup your theme and move it where ever you want and you don’t have to worry that the theme folder is even named the same.</p>
<p>Here’s a listing of ALL the settings you can use with “bloginfo()”. <a title="http://codex.wordpress.org/Function_Reference/bloginfo" href="http://codex.wordpress.org/Function_Reference/bloginfo">http://codex.wordpress.org/Function_Reference/bloginfo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jaredheinrichs.com/wordpress-how-to-use-wordpress-settings-in-your-theme.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress &#8211; How to fix next_posts_link() doesn&#8217;t work</title>
		<link>http://jaredheinrichs.com/wordpress-how-to-fix-next_posts_link-doesnt-work.html</link>
		<comments>http://jaredheinrichs.com/wordpress-how-to-fix-next_posts_link-doesnt-work.html#comments</comments>
		<pubDate>Mon, 26 Sep 2011 06:40:25 +0000</pubDate>
		<dc:creator>Jared Heinrichs</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[How To]]></category>

		<guid isPermaLink="false">http://jaredheinrichs.com/wordpress-how-to-fix-next_posts_link-doesnt-work.html</guid>
		<description><![CDATA[I first off want to thank Chris Coyier of css-tricks.com! If you’ve never seen or heard of Chris you don’t know what you are missing. My answer to this question came from watching the 31:14 minute video on css-tricks called &#8230; <a href="http://jaredheinrichs.com/wordpress-how-to-fix-next_posts_link-doesnt-work.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I first off want to thank Chris Coyier of css-tricks.com! If you’ve never seen or heard of Chris you don’t know what you are missing. My answer to this question came from watching the 31:14 minute video on css-tricks called “<a href="http://css-tricks.com/video-screencasts/91-the-wordpress-loop/" target="_blank">the WordPress Loop</a>”.</p>
<p>The most likely reason why next_post_link() doesn’t work in your theme is mostly do to how you setup the loop. The part of the loop that is most likely not setup is the “paging” part of it. Because paging isn’t setup you display the same content OVER and OVER each time you click on the “Newer Entries”. By setting up paging you are telling WordPress to display “X” amount of posts per page. The “offset” tells WordPress where to start on the next page.</p>
<p>I will post a screenshot of some code and go over what you need to do:</p>
<p><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Wordpress - How to fix next_posts_link() doesn’t work" border="0" alt="Wordpress - How to fix next_posts_link() doesn’t work" src="http://jaredheinrichs.com/wp-content/uploads/2011/09/image30.png" width="540" height="433" /></p>
<p>We need to use the “query_posts()” function (Line 15). In order to get the query that you want you should make a few variables first.</p>
<ul>
<li>On line 12 we create a variable called “ppp” (Posts Per Page) and give it a number.</li>
<li>On line 13 we create the offset variable. This will help with a term called “Paging”.</li>
</ul>
<p>Now that we have the variables setup we are going to create a custom WordPress Loop. To do this we need to make a new query.</p>
<ul>
<li>On line 15 I show you how to make a custom query using the variables we created earlier.</li>
</ul>
<p>The query basically says: Go out and get me all the posts. I know I am going to be displaying “2” posts per page. Each time I go and click on “Newer Entries” start at the “offset” and then display another set of posts equaling whatever you set the “ppp” to be. </p>
<p>You might be asking yourself is there another way of doing this? Actually there is if you are using this as the only loop on a page and you want just spit out the blog entries.</p>
<p>Create a page template file and name it “pagetemplate.php” and put it into your theme directory. If you are using the same info in the screenshot the template name you will be able to select in the next step is going to be called “Playing with Loop”. *NOTE* – You won’t need lines 12 to 16!</p>
<p>Create a new page in WordPress and open it. I’m going to call my page “Blog”. On the right hand side under “Page Attributes” you see “Template”. Select “Playing with Loop” and hit update. You must now go and make some changes in the WP Admin area. Go to “settings” and “reading” and select the page that you want to be the default “Posts” page. Since as I previously mentioned I called my page “Blog” I am going to select “Blog” and voila. WordPress now knows that since this page is going to be displaying the posts, the paging will already be setup.</p>
<p><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Wordpress - How to fix next_posts_link() doesn’t work" border="0" alt="Wordpress - How to fix next_posts_link() doesn’t work" src="http://jaredheinrichs.com/wp-content/uploads/2011/09/image31.png" width="531" height="177" /></p>
]]></content:encoded>
			<wfw:commentRss>http://jaredheinrichs.com/wordpress-how-to-fix-next_posts_link-doesnt-work.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress&#8211;How to display the date using General Settings Date Format</title>
		<link>http://jaredheinrichs.com/wordpresshow-to-display-the-date-using-general-settings-date-format.html</link>
		<comments>http://jaredheinrichs.com/wordpresshow-to-display-the-date-using-general-settings-date-format.html#comments</comments>
		<pubDate>Thu, 15 Sep 2011 01:53:32 +0000</pubDate>
		<dc:creator>Jared Heinrichs</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://jaredheinrichs.com/wordpresshow-to-display-the-date-using-general-settings-date-format.html</guid>
		<description><![CDATA[You might have wondered how to display the date of a post on a page by using the Date Format settings. Date Format settings can be found in “General Settings”. Like always, I like creating a function for this as &#8230; <a href="http://jaredheinrichs.com/wordpresshow-to-display-the-date-using-general-settings-date-format.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>You might have wondered how to display the date of a post on a page by using the Date Format settings. Date Format settings can be found in “General Settings”.</p>
<p><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://jaredheinrichs.com/wp-content/uploads/2011/09/image5.png" width="488" height="227" /></p>
<p>Like always, I like creating a function for this as it cleans up my template quite a bit. This also means I can re-use the code over and over again.</p>
<p>Open functions.php and add this to the end of the file:</p>
<p><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://jaredheinrichs.com/wp-content/uploads/2011/09/image6.png" width="382" height="50" /></p>
<p>Now anywhere in your theme you can get the date posted without dealing with the date format. All you need to do is type this:</p>
<p><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://jaredheinrichs.com/wp-content/uploads/2011/09/image7.png" width="224" height="17" /></p>
]]></content:encoded>
			<wfw:commentRss>http://jaredheinrichs.com/wordpresshow-to-display-the-date-using-general-settings-date-format.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress &#8211; How to display the category and tags of a post</title>
		<link>http://jaredheinrichs.com/wordpress-how-to-display-the-category-and-tags-of-a-post.html</link>
		<comments>http://jaredheinrichs.com/wordpress-how-to-display-the-category-and-tags-of-a-post.html#comments</comments>
		<pubDate>Wed, 14 Sep 2011 23:26:18 +0000</pubDate>
		<dc:creator>Jared Heinrichs</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://jaredheinrichs.com/wordpress-how-to-display-the-category-and-tags-of-a-post.html</guid>
		<description><![CDATA[Here’s an easy way of displaying what category and tags a WordPress post is part of: &#160; Now that you know how to display the info it would make sense to put this in the functions.php and then call that &#8230; <a href="http://jaredheinrichs.com/wordpress-how-to-display-the-category-and-tags-of-a-post.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here’s an easy way of displaying what category and tags a WordPress post is part of:</p>
<p><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://jaredheinrichs.com/wp-content/uploads/2011/09/image2.png" width="671" height="261" /></p>
<p>&#160;</p>
<p>Now that you know how to display the info it would make sense to put this in the functions.php and then call that function in your wordpress theme. To do this edit your functions.php and add this near the end of the file.</p>
<p><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://jaredheinrichs.com/wp-content/uploads/2011/09/image3.png" width="684" height="279" /></p>
<p>Now all you need to do in your theme is to call:</p>
<p><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://jaredheinrichs.com/wp-content/uploads/2011/09/image4.png" width="735" height="158" /></p>
]]></content:encoded>
			<wfw:commentRss>http://jaredheinrichs.com/wordpress-how-to-display-the-category-and-tags-of-a-post.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Featured Images &#8211; add_image_size() resizing and cropping demo</title>
		<link>http://jaredheinrichs.com/wordpress-featured-images-add_image_size-resizing-and-cropping-demo.html</link>
		<comments>http://jaredheinrichs.com/wordpress-featured-images-add_image_size-resizing-and-cropping-demo.html#comments</comments>
		<pubDate>Wed, 07 Sep 2011 13:28:35 +0000</pubDate>
		<dc:creator>Jared Heinrichs</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://jaredheinrichs.com/wordpress-featured-images-add_image_size-resizing-and-cropping-demo.html</guid>
		<description><![CDATA[I first off want to thank Studio Grasshopper for an awesome post. It was so awesome I am making note of the link. I highly recommend that you take a look at the website for the latest version of the &#8230; <a href="http://jaredheinrichs.com/wordpress-featured-images-add_image_size-resizing-and-cropping-demo.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I first off want to thank Studio Grasshopper for an awesome post. It was so awesome I am making note of the link. I highly recommend that you take a look at the website for the latest version of the information.</p>
<p><a href="http://www.studiograsshopper.ch/web-development/wordpress-featured-images-add_image_size-resizing-and-cropping-demo/">http://www.studiograsshopper.ch/web-development/wordpress-featured-images-add_image_size-resizing-and-cropping-demo/</a></p>
<p>Recently, I have been spending a lot of time developing some new automation functionality for my<a href="http://www.studiograsshopper.ch/dynamic-content-gallery/">Dynamic Content Gallery</a> plugin, working out how best to get the plugin to use WordPress’ Featured Image functionality and to automatically create the correct additional image sizes when adding and uploading images via the WP Admin UI.</p>
<p>During this work I discovered, perhaps to my shame, that I didn’t know quite as much about Media handling in WordPress as I thought I did. I also found out that, sometimes, WordPress does not behave as intuitively as one might expect or, to be more precise, certain behaviours are not so obvious as one might think – such as how best to use the WordPressadd_image_size() function to create additional image sizes.</p>
<p>The purpose of this article is to give detailed information on how to use Featured Images and theadd_image_size() function and, with examples, demonstrate the consequences of using the various cropping and resizing options available in this function. At the same time, I thought it would be useful to take another look at how WordPress handles uploaded images and its default image sizes.</p>
<h5>Article contents</h5>
<p>There’s a lot of information in this long, long article, so here are some links to help you navigate around it!</p>
<ul>
<li><a href="http://www.studiograsshopper.ch/web-development/wordpress-featured-images-add_image_size-resizing-and-cropping-demo/#media-basics">WordPress Media basics – image handling</a>
<ul>
<li><a href="http://www.studiograsshopper.ch/web-development/wordpress-featured-images-add_image_size-resizing-and-cropping-demo/#default-img-sizes">Default image sizes</a></li>
<li><a href="http://www.studiograsshopper.ch/web-development/wordpress-featured-images-add_image_size-resizing-and-cropping-demo/#media-size-options">Understanding the Media Settings size options</a></li>
<li><a href="http://www.studiograsshopper.ch/web-development/wordpress-featured-images-add_image_size-resizing-and-cropping-demo/#created-images">What images does WordPress create during the upload process, exactly?</a></li>
<li><a href="http://www.studiograsshopper.ch/web-development/wordpress-featured-images-add_image_size-resizing-and-cropping-demo/#default-img-file">Default image sizes – dimensions and filenaming</a></li>
</ul>
</li>
<li><a href="http://www.studiograsshopper.ch/web-development/wordpress-featured-images-add_image_size-resizing-and-cropping-demo/#featured-basics">Featured Image basics</a>
<ul>
<li><a href="http://www.studiograsshopper.ch/web-development/wordpress-featured-images-add_image_size-resizing-and-cropping-demo/#activating-featured">Activating the Featured Image functionality</a></li>
<li><a href="http://www.studiograsshopper.ch/web-development/wordpress-featured-images-add_image_size-resizing-and-cropping-demo/#display-featured">Displaying the Featured Image</a></li>
<li><a href="http://www.studiograsshopper.ch/web-development/wordpress-featured-images-add_image_size-resizing-and-cropping-demo/#default-post-thumbnail">Setting a default size for the Featured Image</a></li>
</ul>
</li>
<li><a href="http://www.studiograsshopper.ch/web-development/wordpress-featured-images-add_image_size-resizing-and-cropping-demo/#add-image-size">Using add_image_size() to customise the Featured Image</a>
<ul>
<li><a href="http://www.studiograsshopper.ch/web-development/wordpress-featured-images-add_image_size-resizing-and-cropping-demo/#configure-add-image">Configuring the add_image_size() function</a></li>
<li><a href="http://www.studiograsshopper.ch/web-development/wordpress-featured-images-add_image_size-resizing-and-cropping-demo/#display-additional-sizes">Displaying the additional image sizes in your theme</a></li>
<li><a href="http://www.studiograsshopper.ch/web-development/wordpress-featured-images-add_image_size-resizing-and-cropping-demo/#old-images">Dealing with images already on the server</a></li>
</ul>
</li>
<li><a href="http://www.studiograsshopper.ch/web-development/wordpress-featured-images-add_image_size-resizing-and-cropping-demo/#add-image-examples">Examples using add_image_size()</a></li>
</ul>
<h5>WordPress Media basics – image handling</h5>
<p>It’s essential to understand the main aspects of the way WordPress handles media images before we look at the Featured Image functionality and the use of additional image sizes added via the add_image_size()function…</p>
<h6>Default image sizes</h6>
<p>Whether you upload an image via the Media Uploader (Add Media button) in the Post Editor, or directly into the Media Library via the Dashboard &gt; Media &gt; Add New panel, WordPress automatically creates several versions of the image during the “crunching…” phase of the upload process, and places these versions on your server:</p>
<ul>
<li>Thumbnail size </li>
<li>Medium size </li>
<li>Large size </li>
<li>plus the Original image, if larger than the Large Size dimensions</li>
</ul>
<p>The dimensions of these default image sizes are set in the Dashboard &gt; Settings &gt; Media options (see screenshot) and, by default, are set as follows:</p>
<p><img title="wp-media-settings-580" alt="WordPress Media Settings" src="http://www.studiograsshopper.ch/wp-content/uploads/2010/11/wp-media-settings-580.jpg" width="580" height="210" /></p>
<p>Default WordPress media Settings (Dashboard&gt;Settings&gt;Media)</p>
<ul>
<li>The default Thumbnail Size is 150px x 150px (with a cropping option, which we will discuss later on) </li>
<li>The default Medium Size is max width 300px, max height 300px </li>
<li>The default Large Size is max width 1024px, max height 1024px</li>
</ul>
<h6>Understanding the Media Settings size options</h6>
<p>WordPress uses two methods to resize images – a “<strong>hard crop</strong>” method, and a “<strong>soft crop</strong>” (or “<strong>box resize</strong>“) method. The Medium and Large Sizes use the “box resize” method, which means that the image size is reduced until the largest dimension (horizontal or vertical) fits inside the “box” determined by the “Max Width” and “Max Height” settings. Let’s look at some examples…</p>
<p>Let’s say we upload an image which is 600px wide by 600px high, the created Medium Size image will be 300px by 300px. This makes sense, given the aspect ratio of 1:1. (See fig 1 below)</p>
<p><img title="medium-600-600" alt="Medium size image example 1" src="http://www.studiograsshopper.ch/wp-content/uploads/2010/11/medium-600-600.jpg" width="580" height="200" /></p>
<p>Fig. 1 Original image of 600px x 600px results in Medium Size image of 300px x 300px</p>
<p>However, if the Original image is 300px wide by 600px high, as the largest dimension in this case is the height, the image is reduced so that the height fits within the Max Height setting of 300px (in a default setup). The original aspect ratio is preserved, therefore the resulting Medium Size image will be 150px wide by 300px high. (See fig 2 below)</p>
<p><img title="medium-150-600" alt="Medium Size image example 2" src="http://www.studiograsshopper.ch/wp-content/uploads/2010/11/medium-150-600.jpg" width="580" height="200" /></p>
<p>Fig. 2 Original image 300px x 600px results in Medium Size image of 150px x 300px</p>
<p>Similarly, if we assume that the Original image is 300px high by 600px wide, the Max Width setting sets the maximum dimension and therefore the resulting Medium Size image will by 150px high by 300px wide. (See fig. 3 below)</p>
<p><img title="medium-600-150" alt="Medium Size image example 3" src="http://www.studiograsshopper.ch/wp-content/uploads/2010/11/medium-600-150.jpg" width="580" height="200" /></p>
<p>Fig. 3 Original image 600px x 300px results in Medium Size image of 300px x 150px</p>
<p>In other words, the original image is reduced until it fits inside the 300px by 300px “box” – hence the term “box resize”.</p>
<p>It is important to note that “box resize” is always used for Medium and Large Sizes. This means that the image is always resized to fit within the “box” and <u>no cropping occurs</u>. <em><strong>Note</strong>: the blue box outline in the above diagrams represents this “box”</em>.</p>
<p>Significantly, the Thumbnail setting can either use the “box resize” method or, if the “Crop” box is checked, the “hard cropping” method, meaning that the resulting Thumbnail Size image will always be sized as per the specifed Width and Height settings. This means <u>cropping will occur</u> if the original image size has a different aspect ratio to that implied by the Thumbnail Width and Height settings. To use the “box resize” method, uncheck the Thumbnail “Crop” box.</p>
<p>Checking the “Crop” option means you always get what you asked for. Therefore, assuming default Thumbnail sizes, providing both the height and width of the original image are larger than 150px, you will get a 150px x 150px sized Thumbnail – with cropping, of course, where necessary.</p>
<h6>What images does WordPress create during the upload process, exactly?</h6>
<p>This depends on the size of the Original image…</p>
<ul>
<li>If the Original image is bigger than the Large Size dimensions set in the Media size options, 4 images will be saved on the server: a Thumbnail version, a Medium version, a Large version, and the original image itself. </li>
<li>WordPress uses a downsizing function to create the Thumbnail, Medium and Large versions. WordPress never “upsizes” images – ie, it never creates a version larger than the original image size. Therefore, if the Original image is smaller than the Large Size dimensions, a Large Size version is not created. </li>
<li>If the Original image is smaller than the Medium Size dimensions, neither Medium nor Large Size versions will be created. </li>
<li>The Original image is identified as “Full Size” in the Media pop-up screen. </li>
<li>The Thumbnail, Medium and Large Size images are named using the original filename plus the <u>actual</u>dimensions of the resulting image size. (See table below for examples.)</li>
</ul>
<h6>Default image sizes – dimensions and filenaming</h6>
<p>As mentioned earlier, the dimensions of the resulting image sizes are appended to the Original file’s filename to create the filenames for the three sizes.</p>
<p>For example, uploading a 1200px x 1200px image named <em>myimage.jpg</em> will result in 3 files being saved in the relevant wp-content/uploads folder, in additional to the Full Size original:</p>
<ul>
<li>The Thumbnail Size version will be named <em>myimage-150×150.jpg</em></li>
<li>The Medium Size version will be named <em>myimage-300×300.jpg</em></li>
<li>The Large Size version will be named <em>myimage-1024×1024.jpg</em></li>
</ul>
<p>Note that, in the above example, the additional image sizes preserve the 1:1 aspect ratio of the original image (1200px x 1200px), which is why the dimensions of the resulting image appended to the original file name happen to correspond to the default Media sizes. In most real world examples the aspect ratio of the Original image will not be 1:1, meaning that the appended dimensions will be different to those shown above.</p>
<p>The following table gives some further examples for a variety of different original image sizes. In all cases, for simplicity, the examples assume the default Media sizes are used, as set in Dashboard &gt; Settings &gt; Media:</p>
<p>Ex:   <br />Original image dimensions    <br />width x height    <br />Default Media    <br />Images created on the server</p>
<p><strong>1.</strong>    <br />myimage.jpg, 1200px x 1200px    <br />Thumbnail    <br />Medium    <br />Large    <br />Full Size    <br />myimage-150×150.jpg    <br />myimage-300×300.jpg    <br />myimage-1024×1024.jpg    <br />myimage.jpg</p>
<p><strong>2.</strong>    <br />myimage.jpg, 900px x 900px    <br />Thumbnail    <br />Medium    <br />Large    <br />Full Size    <br />myimage-150×150.jpg    <br />myimage-300×300.jpg    <br />-    <br />myimage.jpg</p>
<p><strong>3.</strong>    <br />myimage.jpg, 500px x 250px    <br />Thumbnail (crop unchecked)    <br />Medium    <br />Large    <br />Full Size    <br />myimage-150×75.jpg    <br />myimage-300×150.jpg    <br />-    <br />myimage.jpg</p>
<p><strong>4.</strong>    <br />myimage.jpg, 1200px x 600px *    <br />Thumbnail (crop checked)    <br />Medium    <br />Large    <br />Full Size    <br />myimage-150×150.jpg    <br />myimage-300×150.jpg    <br />myimage-1024×506.jpg    <br />myimage.jpg</p>
<p>Some points to note:</p>
<ul>
<li><strong>Ex.1</strong>: The original image is larger than the Large Size dimensions, therefore 3 additional image sizes are created by WordPress, in addition to the original image. </li>
<li><strong>Ex.2</strong>: The original image size is smaller than the Large Size dimensions, therefore no Large Size image is created. </li>
<li><strong>Ex.3</strong>: The original image size is smaller than the Medium Size dimensions, therefore neither a Medium nor a Large Size image is created. Only two images will be placed on the server – the Thumbnail and the Full Size (original) images. As the Thumbnail box is unchecked, the resulting Thumbnail size is proportional (ie “box resize” method”), which is reflected in the dimensions appended to this size. </li>
<li><strong>Ex.4</strong>: In this example the original image is rectangular (with an aspect ratio of 2:1), and we see WordPress preserves this aspect ratio during the downsizing. Note that the dimensions appended to the filename reflect the actual dimensions of the new images. </li>
<li><strong>Ex.4</strong>: This example assumes that the “crop” checkbox in the Media Settings has been checked. Therefore, for the Thumbnail Size, the original aspect ratio is ignored and a thumbnail of exactly 150px x 150px is created. If the checkbox is unchecked, the aspect ratio is preserved and the Thumbnail Size image will be, in this example, 150px x 75px.</li>
</ul>
<h5>Featured Image basics</h5>
<h6>Activating the Featured Image functionality</h6>
<p>Featured Images are not enabled automatically. This functionality needs to be enabled in your theme, which you do by adding this code somewhere in your theme’s functions.php:</p>
<pre>add_theme_support('post-thumbnails');</pre>
<p>If you now go to the Post or Page Editor you should see a Featured Image box on the right hand side of the screen:</p>
<p><img title="Featured-image-box" alt="Featured Image box in Post Editor" src="http://www.studiograsshopper.ch/wp-content/uploads/2010/11/Featured-image-box.png" width="299" height="76" /></p>
<p>Featured Image box in Post/Page Editor</p>
<p>Click on the “Set featured image” link to launch the Media Uploader where you can either upload a new image and set it as the Featured Image, or select an existing image from the Post/Page gallery or Media library. Bear in mind that setting a Featured Image in the Post/Page Editor only registers a particular Original image as the Featured Image for that post – it doesn’t select any specific image size for display. Read on to learn more…</p>
<h6>Displaying the Featured Image</h6>
<p>The following function is used to display the Featured Image:</p>
<pre>&lt;?php the_post_thumbnail(); ?&gt;</pre>
<p>This code should be used in the relevant theme template within the <a href="http://codex.wordpress.org/The_Loop">Loop</a>. More information about this function can be found on the Codex <a href="http://codex.wordpress.org/Function_Reference/the_post_thumbnail">here</a>.</p>
<h6>Setting a default size for the Featured Image</h6>
<p>By default, the the_post_thumbnail() function displays the registered “post-thumbnail” size of your Featured Image. <strong><em>Please note that “post-thumbnail” is not the same thing as the Thumbnail Size that we discussed earlier</em></strong>. Yes, I know, this is confusing, just bear with me…</p>
<p>We talk about Featured Images but the underlying functions use the term “post thumbnail”. This is just one of those things that happen when developers start out on one track – to make an easy to access thumbnail for a post, typical of magazine-style themes – but end up making something much more generic and useful. In an ideal world the_post_thumbnail() function would be renamed as the_featured_image() – which would make much more sense. So, just to clarify, WordPress Post Thumbnails and Featured Images are the same thing.</p>
<p>The “post-thumbnail” image size is registered using the set_post_thumbnail_size() function. This function takes 3 arguments: $width, $height and $crop_flag and, for example, is used in your theme’sfunctions.php like this if you want to specify a “post-thumbnail” size of 100px by 100px, with “hard cropping”:</p>
<pre>set_post_thumbnail_size( 100, 100, true );</pre>
<p>Our functions.php code now looks like this:</p>
<pre>add_theme_support('post-thumbnails');
set_post_thumbnail_size( 100, 100, true );</pre>
<p>Obviously, you don’t have to use 100px x 100px, so change the functions parameters to suit your theme layout/design.</p>
<p>Note that this function does not create a new 100px x 100px version of the Original image on your server – it simply adds height and width attributes of 100px to the IMG tag, which is output bythe_post_thumbnail(), and lets the browser do the resizing. This has two major drawbacks: firstly, the Original image could be huge meaning that your page load time will be affected and, secondly, browser resizing rarely creates great looking images.</p>
<p>If you don’t specify a “post-thumbnail” size using set_post_thumbnail_size(), the Original image will be displayed – which is probably NOT what you want. We’ll look at a better way of handling the display of Featured Images next…</p>
<h5>Using add_image_size() to customise the Featured Image</h5>
<p>As mentioned above, the set_post_thumbnail_size() function doesn’t, as at WordPress version 3.0.1, actually resize the image – it just resizes it in the browser. Although it is quite likely that on-the-fly resizing will be possible in a future version of WordPress, until this is implemented I don’t recommend using this function. Instead, I prefer creating any additional image sizes at the Media upload process, by using theadd_image_size() function:</p>
<pre>add_image_size( $name, $width, $height, $crop);</pre>
<p>Once you have added this function to your theme’s functions.php your new image sizes will be created alongside the default Thumbnail, Medium and Large sizes during the Media upload process.</p>
<h6>Configuring the add_image_size() function</h6>
<p>Let’s take a closer look at this functions parameters…</p>
<ul>
<li><strong>$name</strong>: a unique name for your image size, eg “Home page”, or “Archive page” or something similar </li>
<li><strong>$width</strong>: the width, in pixels, of this image size </li>
<li><strong>$height</strong>: the height, in pixels, of this image size </li>
<li><strong>$crop</strong>: true to indicate “hard cropping” or false to indicate “box resize”. Review <a href="http://www.studiograsshopper.ch/web-development/wordpress-featured-images-add_image_size-resizing-and-cropping-demo/#media-size-options">this section</a> of this article if you’re not sure of the difference between the two.</li>
</ul>
<p>For example, to specify a new image size called “Home page”, sized at 120px x 120px, and hard cropped, this is what you would add to your theme’s functions.php:</p>
<pre>add_image_size('Home page', 120, 120, true);</pre>
<p>Or perhaps you prefer to create a new image size of 300px x 150px without “hard cropping”:</p>
<pre>add_image_size('Special archive', 300, 150, false);</pre>
<p>And, of course, there is nothing stopping you adding several image sizes, each of which will be used in different parts of your theme:</p>
<pre>add_image_size('Home Top', 120, 120, true);
add_image_size('Home bottom', 270, 90, false);
add_image_size('Archive thumb', 150, 75, true);
add_image_size('Special', 397, 224, true);</pre>
<p>Just remember that this code goes in your theme’s functions.php.</p>
<p>Feel free to add as many image sizes as you want, but bear in mind that this will slow down the Media uploader “crunching…” a little (depending on your hosting), and will use more space on your server to store these images.</p>
<h6>Displaying the additional image sizes in your theme</h6>
<p>You can now reference these new additional image sizes in your theme template files using thethe_post_thumbnail(); function discussed <a href="http://www.studiograsshopper.ch/web-development/wordpress-featured-images-add_image_size-resizing-and-cropping-demo/#display-featured">here</a>, for example like this:</p>
<pre>&lt;?php the_post_thumbnail('Home Top'); ?&gt;</pre>
<p>We should not forget about the default Media sizes either. You can display these in the same way, like this:</p>
<pre>the_post_thumbnail('medium'): // The Medium Size version</pre>
<p>Or this:</p>
<pre>the_post_thumbnail('large'): // The Large Size version</pre>
<p>Or this:</p>
<pre>the_post_thumbnail('thumbnail'): // The Thumbnail Size version</pre>
<p>Remember – this code should go within the <a href="http://codex.wordpress.org/The_Loop">Loop</a> in the relevant theme template file.</p>
<p>The important advantages of going to all this trouble to create additional image sizes usingadd_image_size(), rather than use set_post_thumbnail_size(), are:</p>
<ul>
<li>add_image_size() creates an image at the correct size – no more browser resizing. </li>
<li>You can use add_image_size() as many times as you like to specify a range of image sizes for use in your theme.</li>
</ul>
<h6>Dealing with images already on the server</h6>
<p>The function add_image_size() will only create additional images for new uploads. Therefore, if you want to retroactively create the new additional images for previously uplaoded images, your best option is to use the rather wonderful <a href="http://wordpress.org/extend/plugins/regenerate-thumbnails/">Regenerate Thumbnails</a> plugin. Highly recommended!</p>
<h5>Examples using add_image_size()</h5>
<p>Finally, here is a series of test images to demonstrate the results of using various image sizes and, in particular, the two cropping options of the add_image_size() function.</p>
<p>Each example shows the add_image_size() code used to generate the image. The Original image is 600px x 400px. Note “thirds” grid superimposed on the Original image to help indicate what has been cropped during the creation of various image sizes.</p>
<h6>Original image</h6>
<p>Original Size: 600px x 400px<br />
  <br />Original Aspect ratio: 3:2</p>
<p><img alt="Original image" src="http://studiograsshopper.ch/wp-content/uploads/special/Ducati-848-Evo-Test.jpg" /></p>
<hr />
<h6>Added size: 500 x 500, hard cropped</h6>
<p>Resulting Size: 500px x 400px</p>
<p>Resulting Aspect ratio: 5:4</p>
<p>Image has been cropped (left and right) </p>
<p><img alt="Additional image size 500 x 500, hard crop" src="http://studiograsshopper.ch/wp-content/uploads/special/Ducati-848-Evo-Test-500x400.jpg" /></p>
<pre>add_image_size( 'Test cropped', 500, 500, true );</pre>
<hr />
<h6>Added size: 500 x 500, box resize</h6>
<p>Resulting Size: 500px x 333px<br />
  <br />Resulting Aspect ratio: 3:2 (same as Original)</p>
<p>Image has been resized to fit in “box”, original aspect ratio is preserved, not cropped</p>
<p><img alt="Additional image size 500 x 500, box resize" src="http://studiograsshopper.ch/wp-content/uploads/special/Ducati-848-Evo-Test-500x333.jpg" /></p>
<pre>add_image_size( 'Test box resize', 500, 500, false );</pre>
<hr />
<h6>Added size: 500 x 300, hard cropped</h6>
<p>Resulting Size: 500px x 300px<br />
  <br />Resulting Aspect ratio: 5:3</p>
<p>Image has been cropped (top and bottom)</p>
<p><img alt="Additional image size 500 x 300, hard crop" src="http://studiograsshopper.ch/wp-content/uploads/special/Ducati-848-Evo-Test-500x300.jpg" /></p>
<pre>add_image_size( 'Smaller Test cropped', 500, 300, true );</pre>
<hr />
<h6>Added size: 500 x 300, box resize</h6>
<p>Resulting Size: 450px x 300px<br />
  <br />Resulting Aspect ratio: 3:2 (same as Original)</p>
<p>Image has been resized to fit in “box”, original aspect ratio is preserved, not cropped</p>
<p><img alt="Additional image size 500 x 300, box resize" src="http://studiograsshopper.ch/wp-content/uploads/special/Ducati-848-Evo-Test-450x300.jpg" /></p>
<pre>add_image_size( 'Smaller Test resize', 500, 300, false );</pre>
<hr />
<h6>Added size: 100 x 100, hard cropped</h6>
<p>Resulting Size: 100px x 100px<br />
  <br />Resulting Aspect ratio: 1:1</p>
<p>Image has been cropped (left and right)</p>
<p><img alt="Additional image size 100 x 100, hard crop" src="http://studiograsshopper.ch/wp-content/uploads/special/Ducati-848-Evo-Test-100x100.jpg" /></p>
<pre>add_image_size( 'Thumb Test cropped', 100, 100, true );</pre>
<hr />
<h6>Added size: 100 x 75, hard cropped</h6>
<p>Resulting Size: 100px x 75px<br />
  <br />Resulting Aspect ratio: 4:3</p>
<p>Image has been cropped (left and right)</p>
<p><img alt="Additional image size 100 x 75, hard crop" src="http://studiograsshopper.ch/wp-content/uploads/special/Ducati-848-Evo-Test-100x75.jpg" /></p>
<pre>add_image_size( 'Smaller Thumb Test cropped', 100, 75, true );</pre>
<hr />
<h6>Added size: 100 x 75, box resize</h6>
<p>Resulting Size: 100px x 66px<br />
  <br />Resulting Aspect ratio: 3:2 (same as Original)</p>
<p>Image has been resized to fit in “box”, original aspect ratio is preserved, not cropped</p>
<p><img alt="Additional image size 100 x 75, box resize" src="http://studiograsshopper.ch/wp-content/uploads/special/Ducati-848-Evo-Test-100x66.jpg" /></p>
<pre>add_image_size( 'Smaller Thumb Test cropped', 100, 75, false );</pre>
<h5>Conclusion</h5>
<p>As can be seen from the above examples, choose your additional image sizes wisely in order to make sure you get the results you want.</p>
<p>Let’s finish by listing the key points to take away from all of this…</p>
<ul>
<li>You can easily customise the default Media sizes by changing the default sizes in Dashboard &gt; Settings &gt; Media. </li>
<li>To use the Featured Image functionality, you need to add the add_theme_support(‘post-thumbnails’); code to your theme’s functions.php. </li>
<li>Avoid using set_post_thumbnail_size() to set your Featured Image display size – to avoid in-browser resizing </li>
<li>Add your own additional image sizes using add_image_size();</li>
<li>Use the <a href="http://wordpress.org/extend/plugins/regenerate-thumbnails/">Regenerate Thumbnails</a> plugin to create the new additional image sizes for images which already exist on your server </li>
<li>Choose your cropping options wisely when using add_image_size();</li>
<li>Use the “box resize” method if you want to preserve the original aspect ratio of your original image and not have it cropped.</li>
</ul>
<p>Hope this is useful to someone – it took ages to write!</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://jaredheinrichs.com/wordpress-featured-images-add_image_size-resizing-and-cropping-demo.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress &#8211; How to display the caption of a featured image</title>
		<link>http://jaredheinrichs.com/wordpress-how-to-display-the-caption-of-a-featured-image.html</link>
		<comments>http://jaredheinrichs.com/wordpress-how-to-display-the-caption-of-a-featured-image.html#comments</comments>
		<pubDate>Fri, 02 Sep 2011 05:16:03 +0000</pubDate>
		<dc:creator>Jared Heinrichs</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://jaredheinrichs.com/wordpress-how-to-display-the-caption-of-a-featured-image.html</guid>
		<description><![CDATA[At the end of your functions.php template file add this code: Where ever you want to display the caption of the featured image just use the function “the_post_thumbnail_caption()”. See below for an example. *Please note the 3rd line should really &#8230; <a href="http://jaredheinrichs.com/wordpress-how-to-display-the-caption-of-a-featured-image.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>At the end of your functions.php template file add this code:</p>
<p><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://jaredheinrichs.com/wp-content/uploads/2011/09/image.png" width="682" height="183" /></p>
<p>Where ever you want to display the caption of the featured image just use the function “the_post_thumbnail_caption()”. See below for an example.</p>
<p><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://jaredheinrichs.com/wp-content/uploads/2011/09/image1.png" width="652" height="97" /></p>
<p>*Please note the 3rd line should really be just a continuation of the 2nd line with a space between the “ and the height=… *</p>
]]></content:encoded>
			<wfw:commentRss>http://jaredheinrichs.com/wordpress-how-to-display-the-caption-of-a-featured-image.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

