<?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>Beginwithanidea &#187; Coding</title>
	<atom:link href="http://beginwithanidea.com/category/coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://beginwithanidea.com</link>
	<description>Creative &#38; Technology Articles</description>
	<lastBuildDate>Fri, 05 Mar 2010 12:56:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Creating a featured post section w/thumbnails</title>
		<link>http://beginwithanidea.com/coding/wordpress/creating-a-featured-post-section-wthumbnails/</link>
		<comments>http://beginwithanidea.com/coding/wordpress/creating-a-featured-post-section-wthumbnails/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 21:26:44 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://beginwithanidea.com/?p=223</guid>
		<description><![CDATA[For my first tutorial I will create a featured post section using the new the_post_thumbnail(); function.
This can be implemented on your home page or sidebar file easily.]]></description>
			<content:encoded><![CDATA[<p><img src="http://beginwithanidea.com/wp-content/uploads/2010/01/wp_tuts-548x365.jpg" alt="" title="wordpress tutorials" width="548" height="365" class="aligncenter size-medium wp-image-229" /><br />
For my first tutorial I will create a featured post section using the new the_post_thumbnail(); function.<br />
This can be implemented on your home page or sidebar file easily.</p>
<h3>1) Activating your the_post_thumbnail(); function</h3>
<p>Follow our own post here: <a href="http://beginwithanidea.com/coding/wordpress/post-thumbnail-wp-29/" title=" the_post_thumbnail();">the_post_thumbnail();</a></p>
<h3>2) Creating a php file for your featured section.</h3>
<p>Now that you activated you thumbnail function we can go ahead and create a php file that will be used to call our featured section where we want it on our site. </p>
<p><strong>Why create a php file instead of coding it directly in the theme files?</strong><br />
Well the answer is pretty simple. By doing so, if any changes are necessary in the featured post and you are calling the section at more then one place, you will be able to update them all in one single place.</p>
<p><strong>Create a file called featured.php in your theme.</strong></p>
<h3>3) Implementing the right code</h3>
<p>For our featured section we will want to create a specific category for it. For the lesson, let&#8217;s call it Featured.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;">&lt;div id=&quot;featured_container&quot;&lt;/div&gt;
<span class="kw2">&lt;?php</span> query_posts<span class="br0">&#40;</span><span class="st_h">'category_name=featured&amp;showposts=3'</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="sy1">?&gt;</span>
&nbsp;
<span class="kw2">&lt;?php</span> <span class="kw1">while</span> <span class="br0">&#40;</span>have_posts<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="sy0">:</span> the_post<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="sy1">?&gt;</span>
&nbsp;
&lt;div class=&quot;featured_single&quot;&lt;/div&gt;
        &lt;div class=&quot;featured_image&quot;&gt;
                 &lt;a href=&quot;<span class="kw2">&lt;?php</span> the_permalink<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy1">?&gt;</span>&quot; title=&quot;<span class="kw2">&lt;?php</span> the_title<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="sy1">?&gt;</span>&quot;&gt;<span class="kw2">&lt;?php</span> the_post_thumbnail<span class="br0">&#40;</span><a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="nu0">60</span><span class="sy0">,</span> <span class="nu0">60</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="sy1">?&gt;</span>&lt;/a&gt;
        &lt;/div&gt;       
         &lt;h2 class=&quot;featured-title&quot;&gt;
                &lt;a href=&quot;<span class="kw2">&lt;?php</span> the_permalink<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy1">?&gt;</span>&quot; title=&quot;<span class="kw2">&lt;?php</span> the_title<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="sy1">?&gt;</span>&quot;&gt;<span class="kw2">&lt;?php</span> the_title<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="sy1">?&gt;</span>&lt;/a&gt;
        &lt;/h2&gt;
&lt;/div&gt;
&nbsp;
<span class="kw2">&lt;?php</span> <span class="kw1">endwhile</span><span class="sy0">;</span><span class="sy1">?&gt;</span>
&lt;/div&gt;</pre></div></div>

<p>Let me breakdown this code for you.<br />
First is the query. This is where we are fetching our posts from our featured category and the showpost function is to only fetch the latest 3.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;"><span class="kw2">&lt;?php</span> query_posts<span class="br0">&#40;</span><span class="st_h">'category_name=featured&amp;showposts=3'</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="sy1">?&gt;</span></pre></div></div>

<p>The rest of the code between the query is regular post code. The first one is to fetch the post thumbnail which has a size of 60px by 60px. The second one will return the title of the post. Both of them will be links to the actual post.</p>
<h3>4) Calling our file</h3>
<p>Final step is fetching the featured.php file in your wordpress theme. This will be done by using an include tag:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;"><span class="kw2">&lt;?php</span> <span class="kw1">include</span><span class="br0">&#40;</span> TEMPLATEPATH <span class="sy0">.</span> <span class="st_h">'/featured.php'</span> <span class="br0">&#41;</span><span class="sy0">;</span> <span class="sy1">?&gt;</span></pre></div></div>

<p>Save your theme file where you included the featured.php tag.</p>
<p>Note that you will need to implement some new css to make your featured section pretty.<br />
here&#8217;s an option you can use:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;"><span class="re0">#featured_container</span> <span class="br0">&#123;</span><span class="kw1">width</span><span class="sy0">:</span> <span class="re3">300px</span><span class="sy0">;</span> <span class="kw1">background</span><span class="sy0">:</span> <span class="re0">#ddd</span><span class="sy0">;</span> <span class="kw1">border</span><span class="sy0">:</span> <span class="re3">2px</span> <span class="kw2">solid</span> <span class="re0">#a1a1a1</span><span class="sy0">;</span><span class="br0">&#125;</span>
<span class="re1">.featured_single</span> <span class="br0">&#123;</span><span class="kw1">width</span><span class="sy0">:</span><span class="re3">300px</span><span class="sy0">;</span> <span class="kw1">display</span><span class="sy0">:</span> <span class="kw2">block</span><span class="sy0">;</span> <span class="kw1">background</span><span class="sy0">:</span> <span class="re0">#fff</span><span class="sy0">;</span> <span class="kw1">padding</span><span class="sy0">:</span> <span class="re3">10px</span> <span class="re3">15px</span><span class="sy0">;</span><span class="br0">&#125;</span>
<span class="re1">.featured_image</span> <span class="br0">&#123;</span><span class="kw1">margin-right</span><span class="sy0">:</span> <span class="re3">15px</span><span class="sy0">;</span><span class="br0">&#125;</span>
<span class="re1">.featured_image</span> a <span class="br0">&#123;</span><span class="kw1">border</span><span class="sy0">:</span> <span class="re3">2px</span> <span class="kw2">solid</span> <span class="re0">#ddd</span><span class="sy0">;</span> <span class="kw1">float</span><span class="sy0">:</span><span class="kw1">left</span><span class="sy0">;</span> <span class="kw1">display</span><span class="sy0">:</span> <span class="kw2">block</span><span class="sy0">;</span> <span class="kw1">width</span><span class="sy0">:</span> <span class="re3">60px</span><span class="sy0">;</span> <span class="kw1">height</span><span class="sy0">:</span> <span class="re3">60px</span> <span class="br0">&#125;</span>
<span class="re1">.featured_title</span> h2 <span class="br0">&#123;</span><span class="kw1">float</span><span class="sy0">:</span> <span class="kw1">left</span><span class="sy0">;</span> <span class="kw1">display</span><span class="sy0">:</span> <span class="kw2">block</span><span class="sy0">;</span><span class="br0">&#125;</span></pre></div></div>

<h3>Optional</h3>
<p>Some people will bring up the fact that these post will be duplicated on the site. To counter this we will have to add variables in our page query and our featured query. You can follow this resource to resolve this:<br />
<a href="How to: Use two (or more) loops without duplicate posts" target="_blank">How to: Use two (or more) loops without duplicate posts</a> </p>
<h3>Related information</h3>
<p><a href="http://codex.wordpress.org/Include_Tags" title="Wordpress Include Tags codex">Wordpress Include Tags codex</a><br />
<a href="http://codex.wordpress.org/The_Loop" title="Wordpress Loop codex">Wordpress Loop codex</a><br />
<a href="http://codex.wordpress.org/Pages" title="Wordpress page codex">Wordpress Page codex</a><br />
<a href="http://beginwithanidea.com/coding/wordpress/post-thumbnail-wp-29/" title=" the_post_thumbnail();">Activating Post Thumbnail function</a></p>
]]></content:encoded>
			<wfw:commentRss>http://beginwithanidea.com/coding/wordpress/creating-a-featured-post-section-wthumbnails/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Post_thumbnail in WP 2.9</title>
		<link>http://beginwithanidea.com/coding/wordpress/post-thumbnail-wp-29/</link>
		<comments>http://beginwithanidea.com/coding/wordpress/post-thumbnail-wp-29/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 22:26:51 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://beginwithanidea.com/?p=92</guid>
		<description><![CDATA[
Wordpress introduces a new standardized way to use post thumbnails to your blog. With the heavy use of this feature from all sorts of theme or plugins it was only a matter of time that Automatic decided to come out with their integrated solution. In this post I will run you through in order to [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-medium wp-image-101" title="Post Thumbnails" src="http://beginwithanidea.com/wp-content/uploads/2009/12/post-thumbnails-548x365.jpg" alt="" width="548" height="365" /><br />
Wordpress introduces a new standardized way to use post thumbnails to your blog. With the heavy use of this feature from all sorts of theme or plugins it was only a matter of time that Automatic decided to come out with their integrated solution. In this post I will run you through in order to have that feature running on your site.</p>
<h3>1) Activation</h3>
<p>First you will need to activate this feature in order to tell WP&#8217;s UI that you are requiring this.<br />
In your theme <em>functions.php</em> file you will need to add these lines:</p>
<pre><code>add_theme_support('post-thumbnails');</code></pre>
<p>For backwards compatibility of your theme you should wrap this inside a function check for the new add_theme_support:</p>
<pre><code>if ( function_exists( 'add_theme_support' ) )
add_theme_support( 'post-thumbnails' );</code></pre>
<h3>2) New post/page widget</h3>
<p><img class="alignright size-full wp-image-95" title="Screen shot 2009-12-28 at 4.38.56 PM" src="http://beginwithanidea.com/wp-content/uploads/2009/12/Screen-shot-2009-12-28-at-4.38.56-PM.jpg" alt="" width="301" height="88" />After initializing your function go to a post and check out the new &#8220;<em>Post Thumbnail</em>&#8221; widget available under your &#8220;<em>Categories</em>&#8220;. Sweet! now you can upload a picture and chose the thumbnail image size you want to use via the image uploader that you are already been using. the only change will be the &#8220;Use as thumbnail&#8221; link besides the &#8220;insert into post&#8221; button.</p>
<h3>3)Call the thumbnail in your theme</h3>
<p>Next step is to call your thumbnail in your template files.</p>
<pre><code>the_post_thumbnail();</code></pre>
<p>It&#8217;s as simple as this. There are a few other options you can use to customize the your thumbnail output as well</p>
<p>Here is the css output:</p>
<pre><code>.wp-post-image {
border: 2px solid #ccc;
}</code></pre>
<h3>4) Options</h3>
<p>Set your thumbnail to use specific size:</p>
<pre><code>// the thumbnail
the_post_thumbnail(array(100,100));
// medium resolution
the_post_thumbnail(array(300,200));
// large resolution
the_post_thumbnail(array(600, 400));
// original
the_post_thumbnail();</code></pre>
<p>Add your own class:</p>
<pre><code>// align right and the class  'NEW_CLASS'
the_post_thumbnail(array(100,100), array('class' =&gt; 'alignright NEW_CLASS'));</code></pre>
<h3>5) Theme Developer Options</h3>
<p>Here&#8217;s a few options developers can use:<br />
These one are to query the size of the images</p>
<pre><code>// width of the thumbnails
get_option('thumbnail_size_w');
//  height of the thumbnails
get_option('thumbnail_size_h');
//  height of the medium resolution
get_option('medium_size_h');
//  width of the large resolution
get_option('large_size_w');</code></pre>
<pre><code>//  1 = Crop thumbnail to exact dimensions, 0 = Crop off
get_option('thumbnail_crop')</code></pre>
<p>This example has been taken from <a href="http://wpengineer.com/the-ultimative-guide-for-the_post_thumbnail-in-wordpress-2-9/">WpEngineer.com</a></p>
<blockquote><p>Here another example: If the size of a thumbnail is bigger than 100&#215;100 and crop is activated, then the thumbnail should be resized to 100&#215;100, otherwise use the original thumbnail.</p>
<pre><code>if(get_option('thumbnail_size_w') &amp;gt; 100 &amp;amp;&amp;amp; get_option('thumbnail_crop') == 1) {
the_post_thumbnail(array(100,100));
}else{
the_post_thumbnail('thumbnail');
}</code></pre>
</blockquote>
<p>For more info on the_post_thumbnail feature from wp 2.9 you can visit those links:</p>
<p>The always trusty Justin Tadlock:&#8221;<a href="http://justintadlock.com/archives/2009/11/16/everything-you-need-to-know-about-wordpress-2-9s-post-image-feature">Everything you need to know about WordPress 2.9’s post image feature</a>&#8221;<br />
<a href="http://markjaquith.wordpress.com/2009/12/23/new-in-wordpress-2-9-post-thumbnail-images/">New in WordPress 2.9: Post Thumbnail Images</a><br />
<a href="http://www.kremalicious.com/2009/12/wordpress-post-thumbnails/">Using The New Post Thumbnail Feature In WordPress 2.9</a><br />
<a href="http://wpengineer.com/the-ultimative-guide-for-the_post_thumbnail-in-wordpress-2-9/">The Ultimative Guide For the_post_thumbnail In WordPress 2.9</a></p>
]]></content:encoded>
			<wfw:commentRss>http://beginwithanidea.com/coding/wordpress/post-thumbnail-wp-29/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Wordpress 2.9</title>
		<link>http://beginwithanidea.com/coding/wordpress/wordpress-2-9/</link>
		<comments>http://beginwithanidea.com/coding/wordpress/wordpress-2-9/#comments</comments>
		<pubDate>Sat, 26 Dec 2009 22:23:24 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://beginwithanidea.com/?p=37</guid>
		<description><![CDATA[So wordpress 2.9 &#8220;Carmen&#8221; is now out. What new features we&#8217;re added? What is that Carmen title?
Well Wordpress is following a theme with all new releases. They call them by the name of Jazz musicians. Sweet as!
The name comes from Carmen McRae. She&#8217;s a Jazz vocalist.
So what&#8217;s nice with the new wordpress release?

Global undo/”trash” feature which [...]]]></description>
			<content:encoded><![CDATA[<p>So wordpress 2.9 &#8220;Carmen&#8221; is now out. What new features we&#8217;re added? What is that Carmen title?</p>
<p>Well Wordpress is following a theme with all new releases. They call them by the name of Jazz musicians. Sweet as!<br />
The name comes from Carmen McRae. She&#8217;s a Jazz vocalist.</p>
<p>So what&#8217;s nice with the new wordpress release?</p>
<ol>
<li><strong>Global undo/”trash” feature <span style="font-weight: normal;">which means that if you accidentally delete a post or comment you can bring it back from the grave (i.e., the Trash). This also eliminates those annoying “are you sure” messages we used to have on every delete.</span></strong></li>
<li><strong>Built-in image editor</strong> allows you to crop, edit, rotate, flip, and scale your images to show them who’s boss. This is the first wave of our many planned media-handling improvements.</li>
<li><strong>Batch plugin update and compatibility checking</strong>, which means you can update 10 plugins at once, versus having to do multiple clicks for each one, and we’re using the new compatibility data from the plugins directory to give you a better idea of whether your plugins are compatible with new releases of WordPress. This should take the fear and hassle out of upgrading.</li>
<li><strong>Easier video embeds</strong> that allow you to just paste a URL on its own line and have it magically turn it into the proper embed code, with Oembed support for YouTube, Daily Motion, Blip.tv, Flickr, Hulu, Viddler, Qik, Revision3, Scribd, Google Video, Photobucket, PollDaddy, and WordPress.tv (and more in the next release).</li>
</ol>
<p>So those are the main features that everybody will benefit. Some of the more obscure features that affects codere, developper and the performance of wordpress are enumerated <a title="Wordpress 2.9" href="http://wordpress.org/development/2009/12/wordpress-2-9/" target="_blank">here</a>:</p>
<ul>
<li>We now have <code>rel=canonical</code> support for better SEO.</li>
<li>There is automatic database optimization support, which you can enable in your <code>wp-config.php</code> file by adding<code>define('WP_ALLOW_REPAIR', true);</code>.</li>
<li>Themes can register “post thumbnails” which allow them to attach an image to the post, especially useful for magazine-style themes.</li>
<li>A new <code>commentmeta</code> table that allows arbitrary key/value pairs to be attached to comments, just like posts, so you can now expand greatly what you can do in the comment framework.</li>
<li>Custom post types have been upgraded with better API support so you can juggle more types than just post, page, and attachment. (More of this planned for 3.0.)</li>
<li>You can set custom theme directories, so a plugin can register a theme to be bundled with it or you can have multiple shared theme directories on your server.</li>
<li>We’ve upgraded TinyMCE WYSIWYG editing and Simplepie.</li>
<li>Sidebars can now have descriptions so it’s more obvious what and where they do what they do.</li>
<li>Specify category templates not just by ID, like before, but by slug, which will make it easier for theme developers to do custom things with categories — like post types!</li>
<li>Registration and profiles are now extensible to allow you to collect things more easily, like a user’s Twitter account or any other fields you can imagine.</li>
<li>The XML-RPC API has been extended to allow changing the user registration option. We fixed some Atom API attachment issues.</li>
<li>Create custom galleries with the new include and exclude attributes that allow you to pull attachments from any post, not just the current one.</li>
<li>When you’re editing files in the theme and plugin editors it remembers your location and takes you back to that line after you save. (Thank goodness!!!)</li>
<li>The Press This bookmarklet has been improved and is faster than ever; give it a try for on-the-fly blogging from wherever you are on the internet.</li>
<li>Custom taxonomies are now included in the WXR export file and imported correctly.</li>
<li>Better hooks and filters for excerpts, smilies, HTTP requests, user profiles, author links, taxonomies, SSL support, tag clouds, query_posts and WP_Query</li>
</ul>
<p>I really like the new feature of post thumbnail.<br />
This will actually be in one of our next post on wordpress.</p>
]]></content:encoded>
			<wfw:commentRss>http://beginwithanidea.com/coding/wordpress/wordpress-2-9/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

