<?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>Onlinevortex &#187; image</title>
	<atom:link href="http://onlinevortex.com/tag/image/feed/" rel="self" type="application/rss+xml" />
	<link>http://onlinevortex.com</link>
	<description></description>
	<lastBuildDate>Tue, 03 Jan 2012 21:23:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Default Post thumbnails plugin</title>
		<link>http://onlinevortex.com/2010/01/default-post-thumbnails-plugin/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=default-post-thumbnails-plugin</link>
		<comments>http://onlinevortex.com/2010/01/default-post-thumbnails-plugin/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 21:00:31 +0000</pubDate>
		<dc:creator>cmr778</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[thumbnails]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://onlinevortex.com/?p=575</guid>
		<description><![CDATA[With the support for post thumbnails in WordPress 2.9 you can now display a thumbnail image for each post in your site, depending on the theme you are using and if you enabled support for post thumbnails for it. But &#8230; <a href="http://onlinevortex.com/2010/01/default-post-thumbnails-plugin/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>With the support for post thumbnails in WordPress 2.9 you can now display a thumbnail image for each post in your site, depending on the theme you are using and if you enabled support for post thumbnails for it.</p>
<p>But if your site already has hundreds of posts, adding a thumbnail image for each one will be a lot of work even if you only want the same image for each old post.</p>
<p>This plugin allows you to specify a default post thumbnail for posts that doesn’t have a thumbnail set.</p>
<p>This plugin requires that you have enabled support for post thumbnails in your theme (you can enable it by adding these 2 lines in your theme functions.php file).</p>
<p class="code">if ( function_exists(‘add_theme_support’) ) {<br />
add_theme_support(‘post-thumbnails’); }</p>
<p>You can select the thumbnail from the images already uploaded to your media library.</p>
<p style="text-align: center;"><a rel="attachment wp-att-544" href="http://onlinevortex.com/projects/default-postthumbnails/defpostthumbnail2/"><img class="aligncenter size-medium wp-image-544" title="defpostthumbnail2" src="http://onlinevortex.com/wp-content/uploads/2010/01/defpostthumbnail21-300x153.png" alt="" width="300" height="153" /></a></p>
<p>You can see more screenshots of this plugin, how to use it and the download link in the <a href="http://onlinevortex.com/projects/default-postthumbnails/">Default Post Thumbnails</a> page</p>
]]></content:encoded>
			<wfw:commentRss>http://onlinevortex.com/2010/01/default-post-thumbnails-plugin/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Post thumbnails and default images</title>
		<link>http://onlinevortex.com/2009/12/post-thumbnails-and-default-images/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=post-thumbnails-and-default-images</link>
		<comments>http://onlinevortex.com/2009/12/post-thumbnails-and-default-images/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 21:51:07 +0000</pubDate>
		<dc:creator>cmr778</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[thumbnails]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://onlinevortex.com/?p=486</guid>
		<description><![CDATA[In my previous post about post thumbnails with posts excerpts I shared code to display the first image of your post as a thumbnail in your main page and it displayed a default image if the post didn&#8217;t have any &#8230; <a href="http://onlinevortex.com/2009/12/post-thumbnails-and-default-images/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In my previous post about <a href="http://onlinevortex.com/display-the-post-image-with-your-posts-excerpts/">post thumbnails with posts excerpts</a> I shared code to display the first image of your post as a thumbnail in your main page and it displayed a default image if the post didn&#8217;t have any images in it.</p>
<p>Now that WordPress 2.9 was released we can use new functions to display the post image as a thumbnail. This feature is only available if it is enabled specifically in the theme, so to enable it all you have to do is add this 2 lines to the functions.php file of your theme.</p>
<p class="code">if ( function_exists(&#8216;add_theme_support&#8217;) )<br />
add_theme_support(&#8216;post-thumbnails&#8217;);</p>
<p>This will enable the post thumbnail functionality and add a new box in your new post pages to set the post thumbnail</p>
<p style="text-align: center;"><img class="size-medium wp-image-487 aligncenter" title="post_thumbnail_box" src="http://onlinevortex.com/wp-content/uploads/2009/12/post_thumbnail_box1-300x88.png" alt="post_thumbnail_box" width="300" height="88" /></p>
<p style="text-align: center;"><img class="size-full wp-image-488 aligncenter" title="post_thumbnail_box2" src="http://onlinevortex.com/wp-content/uploads/2009/12/post_thumbnail_box1211.png" alt="post_thumbnail_box2" width="292" height="176" /></p>
<p>To set an image as thumbnail you upload it like any other image or select it from your media library and at the bottom you will see the text &#8220;Use as thumbnail&#8221;, click on it and that&#8217;s it.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-489" title="post_thumbnail_3" src="http://onlinevortex.com/wp-content/uploads/2009/12/post_thumbnail_311.png" alt="post_thumbnail_3" width="468" height="107" /></p>
<p>Now, to display the thumbnail in your theme you have to use the function <code> the_post_thumbnail()</code>,  the basic usage should be :</p>
<p class="code"><code><br />
if ( current_theme_supports( 'post-thumbnails' ) )<br />
the_post_thumbnail(array(100,100));<br />
</code></p>
<p>Which is pretty simple, and integrated  into the code we have from the <a href="http://onlinevortex.com/display-the-post-image-with-your-posts-excerpts/">previous post about thumbnails</a> should look like this:</p>
<p class="code"><code><br />
if ( function_exists('has_post_thumbnail') &amp;&amp; has_post_thumbnail() ) {<br />
the_post_thumbnail(array(100,100));<br />
} else {<br />
postimage(100,75,'image for: '.get_the_title(),'image');<br />
}<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://onlinevortex.com/2009/12/post-thumbnails-and-default-images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Display the post image with your posts excerpts</title>
		<link>http://onlinevortex.com/2009/11/display-the-post-image-with-your-posts-excerpts/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=display-the-post-image-with-your-posts-excerpts</link>
		<comments>http://onlinevortex.com/2009/11/display-the-post-image-with-your-posts-excerpts/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 17:22:59 +0000</pubDate>
		<dc:creator>cmr778</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[excerpt]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[thumbnails]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://onlinevortex.local/?p=317</guid>
		<description><![CDATA[You spent hours looking for that image that perfectly illustrates your post, but on the main blog page you only display the excerpt. All that work and the impact of the image is lost because the image is only displayed &#8230; <a href="http://onlinevortex.com/2009/11/display-the-post-image-with-your-posts-excerpts/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>You spent hours looking for that image that perfectly illustrates your post, but on the main blog page you only display the excerpt. All that work and the impact of the image is lost because the image is only displayed when the reader is viewing the full post.</p>
<p>You can add this function to your theme functions.php to display the thumbnail image of your post or a default image if the post does not have one.</p>
<p class="code">function postimage($width,$height, $text, $class) {<br />
$scriptpath = get_stylesheet_directory_uri();<br />
$attachments = get_children(array(&#8216;post_parent&#8217; =&gt; get_the_ID(), &#8216;post_type&#8217; =&gt; &#8216;attachment&#8217;, &#8216;post_mime_type&#8217; =&gt; &#8216;image&#8217;, &#8216;orderby&#8217; =&gt; &#8216;menu_order&#8217;));<br />
if (!is_array($attachments)) {<br />
$image = $scriptpath.&#8221;/images/default.jpg&#8221;;<br />
echo &#8216;&lt;img class=&#8221;&#8216;.$class.&#8217;&#8221; title=&#8221;&#8216;.$text.&#8217;&#8221; src=&#8221;&#8216;.$scriptpath.&#8217;/scripts/timthumb.php?w=&#8217;.$width.&#8217;&amp;h=&#8217;.$height.&#8217;&amp;zc=1&amp;q=100&amp;src=&#8217;.$image.&#8217;&#8221; alt=&#8221;&#8216;.$text.&#8217;&#8221; width=&#8221;&#8216;.$width.&#8217;&#8221; height=&#8221;&#8216;.$height.&#8217;&#8221; class=&#8221;&#8216;.$class.&#8217;&#8221; /&gt;&#8217;;<br />
} else {<br />
$img = array_shift($attachments);<br />
$imagelink = wp_get_attachment_image_src($img-&gt;ID,&#8217;full&#8217;);<br />
$image = $imagelink[0];<br />
echo &#8216;&lt;img class=&#8221;&#8216;.$class.&#8217;&#8221; title=&#8221;&#8216;.$text.&#8217;&#8221; src=&#8221;&#8216;.$scriptpath.&#8217;/scripts/timthumb.php?w=&#8217;.$width.&#8217;&amp;h=&#8217;.$height.&#8217;&amp;zc=1&amp;q=100&amp;src=&#8217;.$image.&#8217;&#8221; alt=&#8221;&#8216;.$text.&#8217;&#8221; width=&#8221;&#8216;.$width.&#8217;&#8221; height=&#8221;&#8216;.$height.&#8217;&#8221; class=&#8221;&#8216;.$class.&#8217;&#8221; /&gt;&#8217;;<br />
}<br />
}</p>
<p><strong>How to use it:</strong><br />
In your template add the function before the call to the_excerpt.</p>
<p class="code">&lt;? postimage(100,75,&#8221;image for: &#8220;.get_the_title(),&#8217;image&#8217;)?&gt;<br />
&lt;? the_excerpt(); ?&gt;</p>
<p><em>The parameters are</em>:<br />
$width &amp; $height &#8211; the purpose of these is obvious<br />
&#8220;image for: &#8220;.get_the_title() &#8211; This will become the title and alt text of the image in the tag<br />
image &#8211; this is the class for the tag, with this you can align/float the image to the left/right or apply any style you already defined for the images</p>
<p>This function uses the <a href="http://code.google.com/p/timthumb/">timthumb</a> script to resize and crop the image automatically. after downloading the script, create a subdirectoy named &#8216;scripts&#8217; in your theme directory and copy the timthumb.php file to it. Now create a &#8216;cache&#8217; subdirectory in your theme directory and assign it write permissions, so the script can create the images in that directory and skip the creation of the image on every page request.</p>
<p>If your post does not have an image, the function will display a default image. to define the default image upload the image you want to be used by default to your theme in the images directory and name it &#8216;default.jpg&#8217;</p>
]]></content:encoded>
			<wfw:commentRss>http://onlinevortex.com/2009/11/display-the-post-image-with-your-posts-excerpts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

