<?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>WPShout.com &#187; Theme Design</title> <atom:link href="http://wpshout.com/category/themes/feed/" rel="self" type="application/rss+xml" /><link>http://wpshout.com</link> <description>WordPress Tips, Tricks and Hacks</description> <lastBuildDate>Mon, 30 Aug 2010 11:48:00 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0</generator> <item><title>Better iPhone WordPress Themes</title><link>http://wpshout.com/iphone-wordpress-theme/</link> <comments>http://wpshout.com/iphone-wordpress-theme/#comments</comments> <pubDate>Fri, 04 Jun 2010 13:22:37 +0000</pubDate> <dc:creator>Alex Denning</dc:creator> <category><![CDATA[Theme Design]]></category><guid
isPermaLink="false">http://wpshout.com/?p=2887</guid> <description><![CDATA[Your iPhone optimised WordPress theme doesn't have to be the single column look we often see; there's no reason at all why you can't just slightly simplify your theme and still give iPhone users a decent experience when visiting your site. That's what we'll be doing in today's post, using just CSS.]]></description> <content:encoded><![CDATA[<p><a
href="http://wpshout.com/iphone-wordpress-theme/"target="_blank"title="iPhone WordPress Themes" >iPhone</a> optimised <a
href="http://wpshout.com/theme-house/"target="_blank"title="Free WordPress Themes" >WordPress themes</a> are <strong>nothing new</strong>, in fact, I expect many of you already have iPhone optimised themes using one of the many plugins available. Here&#8217;s the thing though: the iPhone is <em>actually quite good</em> at rendering web pages, so I often find myself switching back to &#8220;desktop&#8221; view when browsing on my iPhone.</p><p><img
src="http://wpshout.com/media/2010/06/apparently-optimised1.png" alt="" title="apparently-optimised" width="550" height="600" class="image alignnone size-full wp-image-2923" /></p><p>Your iPhone optimised WordPress theme doesn&#8217;t have to be the single column look we often see; there&#8217;s no reason at all why you can&#8217;t just slightly simplify your theme and still give iPhone users a decent experience when visiting your site. That&#8217;s what we&#8217;ll be doing in today&#8217;s post, using just CSS.</p><h2>IPhone stylesheets</h2><p>The first thing we need to do is to set up our iPhone specific stylesheet. Put the line below <em>after</em> your normal stylesheet so we can just overwrite some styles using an iphone.css stylesheet uploaded to your theme&#8217;s directory (instead of starting from scratch).</p><div
class="alert">It&#8217;s that easy: you can just tweak a couple of styles and have a lovely iPhone version of your site, looking just like the &#8220;proper&#8221; version.</div><div
class="geshi no xml"><ol><li
class="li1"><div
class="de1"><span
class="sc3"><span
class="re1">&lt;link</span> <span
class="re0">media</span>=<span
class="st0">&quot;only screen and (max-device-width: 480px)&quot;</span> <span
class="re0">href</span>=<span
class="st0">&quot;&lt;?php bloginfo(&#39;template_url&#39;); ?&gt;</span>/iphone.css&quot; type=&quot;text/css&quot; rel=&quot;stylesheet&quot; /&gt;</span></div></li></ol></div><h2>Potential drawbacks</h2><p>Before we get styling, there are some downsides to this method. This isn&#8217;t the most efficient way of doing things as potentially some elements will have to be set to <code>display:none;</code>, meaning that they still load, just aren&#8217;t displayed. This may have <em>some</em> impact on performance but personally I think as long as your site loads quickly normally, it&#8217;ll be fine here.</p><h2>Slim down, load up</h2><p><img
src="http://wpshout.com/media/2010/06/thin-side.png" alt="" title="thin-side" width="550" height="476" class="image alignnone size-full wp-image-2929" /><br
/> So onto the styling. Portrait, the iPhone&#8217;s 320px wide, landscape 480px. Most iPhone specific themes will be 320px, just showing some content. Personally, I see no reason not to just shrink a site slightly, perhaps slimming the sidebar right down to 150px and getting rid of things iPhones can&#8217;t properly display (such as tabs).</p><p>Every site is going to differ, but something like this will probably do the job:</p><div
class="geshi no css"><ol><li
class="li1"><div
class="de1"><span
class="re0">#wrapper</span>, <span
class="re0">#header</span>, <span
class="re0">#footer</span> <span
class="br0">&#123;</span> <span
class="kw1">width</span><span
class="sy0">:</span> <span
class="re3">600px</span><span
class="sy0">;</span> <span
class="br0">&#125;</span></div></li><li
class="li1"><div
class="de1"><span
class="re0">#content</span> <span
class="br0">&#123;</span> <span
class="kw1">width</span><span
class="sy0">:</span> <span
class="re3">480px</span><span
class="sy0">;</span> <span
class="coMULTI">/*margins may need to be set, but we&#39;ll assume they&#39;re inherited from the desktop stylesheet */</span> <span
class="br0">&#125;</span></div></li><li
class="li1"><div
class="de1"><span
class="re0">#sidebar</span> <span
class="br0">&#123;</span> <span
class="kw1">width</span><span
class="sy0">:</span> <span
class="re3">150px</span><span
class="sy0">;</span> <span
class="br0">&#125;</span></div></li></ol></div><p>You then might find that you need to hide some sections, which you can do with <code>display:none;</code>:</p><div
class="geshi no css"><ol><li
class="li1"><div
class="de1"><span
class="re0">#tabs</span>, <span
class="re0">#read-more</span> <span
class="br0">&#123;</span> <span
class="kw1">display</span><span
class="sy0">:</span> <span
class="kw2">none</span><span
class="sy0">;</span> <span
class="br0">&#125;</span></div></li></ol></div><p>Once you&#8217;ve fiddled around with that a bit, you&#8217;ll soon have a delightful iPhone specific WordPress theme for your blog.</p><h2>Custom icons</h2><p><img
src="http://wpshout.com/media/2010/06/build.png" alt="" title="build" width="550" height="476" class="image alignnone size-full wp-image-2932" /><br
/> But we&#8217;re not stopping there though! There is something else that&#8217;s really easy to do (that&#8217;s worth doing too): make an icon so when someone bookmarks your site to their home screen, your custom icon will show up.</p><p>You just need to create a 57&#215;57 PNG without any gloss and upload it to your template&#8217;s directory/images/ and then add the following to the <code>&lt;head/&gt;</code> section:</p><div
class="geshi no xml"><ol><li
class="li1"><div
class="de1"><span
class="sc3"><span
class="re1">&lt;link</span> <span
class="re0">rel</span>=<span
class="st0">&quot;apple-touch-icon-precomposed&quot;</span> <span
class="re0">href</span>=<span
class="st0">&quot;&lt;?php bloginfo(&#39;template_url&#39;); ?&gt;</span>/images/iphone-icon.png&quot; /&gt;</span></div></li></ol></div><h2>For better or worse</h2><p>That&#8217;s all there is to it. It won&#8217;t be for everyone; some might prefer 320px wide layouts, but personally, I find them quite annoying so by making it as much like the desktop site as possible but making it easier to use on an iPhone, I think your readers will love you for it.</p> ]]></content:encoded> <wfw:commentRss>http://wpshout.com/iphone-wordpress-theme/feed/</wfw:commentRss> <slash:comments>15</slash:comments> </item> <item><title>Featured Content For WordPress</title><link>http://wpshout.com/featured-content-wordpress/</link> <comments>http://wpshout.com/featured-content-wordpress/#comments</comments> <pubDate>Mon, 24 May 2010 14:00:41 +0000</pubDate> <dc:creator>Alex Denning</dc:creator> <category><![CDATA[Theme Design]]></category><guid
isPermaLink="false">http://wpshout.com/?p=2812</guid> <description><![CDATA[It's surprisingly easy to build a neat little featured content area in WordPress, using a custom query to grab a couple of posts from a selected category, tag or even custom field. In this post we'll find out how to build a simple featured content area for your blog, rather like the one I recently added to WPShout.]]></description> <content:encoded><![CDATA[<p>It&#8217;s surprisingly easy to build a neat little <a
href="http://wpshout.com/featured-content-wordpress/"target="_blank"title="WordPress Featured Content" >featured content</a> area in WordPress, using a custom query to grab a couple of posts from a selected category, tag or even custom field. In this post we&#8217;ll find out how to build a simple featured content area for your blog, rather like the one I recently added to WPShout:</p><p><a
href="http://wpshout.com/media/2010/05/featured-content.jpg"><img
class="alignnone size-full wp-image-2844" title="featured-content" src="http://wpshout.com/media/2010/05/featured-content.jpg" alt="" width="640" height="218" /></a></p><h2>Choose your posts</h2><p>First thing you need to do is choose which posts you want to have in your featured area. For argument&#8217;s sake, I&#8217;m going to use a category &#8220;featured&#8221;. We&#8217;re going to be building something like what&#8217;s currently on WPShout: no fancy jQuery, just something smart and functional that clearly shows off a couple of posts. Because we&#8217;re showing only three posts, we&#8217;re not going to do the usual and display the three most recent posts, but be bold and randomly pick three posts out of our category &#8220;featured&#8221;. This requires a custom query looking something like this:</p><div
class="geshi no php"><ol><li
class="li1"><div
class="de1"><span
class="kw2">&lt;?php</span></div></li><li
class="li1"><div
class="de1">&nbsp; &nbsp; <span
class="re1">$featured</span> <span
class="sy0">=</span> <span
class="kw2">new</span> WP_Query<span
class="br0">&#40;</span><span
class="br0">&#41;</span><span
class="sy0">;</span></div></li><li
class="li1"><div
class="de1">&nbsp; &nbsp; <span
class="re1">$featured</span><span
class="sy0">-&gt;</span><span
class="me1">query</span><span
class="br0">&#40;</span><span
class="st0">&#39;posts_per_page=3&amp;category_name=Featured&amp;orderby=rand&#39;</span><span
class="br0">&#41;</span><span
class="sy0">;</span></div></li><li
class="li1"><div
class="de1"><span
class="kw2">?&gt;</span></div></li><li
class="li1"><div
class="de1"><span
class="kw2">&lt;?php</span> <span
class="kw1">while</span> <span
class="br0">&#40;</span><span
class="re1">$featured</span><span
class="sy0">-&gt;</span><span
class="me1">have_posts</span><span
class="br0">&#40;</span><span
class="br0">&#41;</span><span
class="br0">&#41;</span> <span
class="sy0">:</span> <span
class="re1">$featured</span><span
class="sy0">-&gt;</span><span
class="me1">the_post</span><span
class="br0">&#40;</span><span
class="br0">&#41;</span><span
class="sy0">;</span> <span
class="kw2">?&gt;</span></div></li><li
class="li1"><div
class="de1">&nbsp;</div></li><li
class="li1"><div
class="de1"><span
class="kw2">&lt;?php</span> <span
class="kw1">endwhile</span><span
class="sy0">;</span> <span
class="kw2">?&gt;</span></div></li></ol></div><div
class="alert">Using a custom query here means we don&#8217;t interfere with the standard loop which you&#8217;ll (presumably) run afterwards.</div><h2>Displaying posts</h2><p>Now that we&#8217;ve got our posts, we need to display them. We&#8217;ll wrap them in a div with the titles wrapped in H2s and linked up, followed by the post&#8217;s excerpt. That&#8217;ll all end up something like this:</p><div
class="geshi no php"><ol><li
class="li1"><div
class="de1"><span
class="sy0">&lt;</span>div <span
class="kw2">class</span><span
class="sy0">=</span><span
class="st0">&quot;featured-post&quot;</span><span
class="sy0">&gt;</span></div></li><li
class="li1"><div
class="de1">&nbsp;<span
class="sy0">&lt;</span>h2<span
class="sy0">&gt;&lt;</span>a href<span
class="sy0">=</span><span
class="st0">&quot;&lt;?php the_permalink(); ?&gt;&quot;</span><span
class="sy0">&gt;&lt;</span>?php the_title<span
class="br0">&#40;</span><span
class="br0">&#41;</span><span
class="sy0">;</span> ?<span
class="sy0">&gt;&lt;/</span>a<span
class="sy0">&gt;&lt;/</span>h2<span
class="sy0">&gt;</span></div></li><li
class="li1"><div
class="de1">&nbsp;<span
class="kw2">&lt;?php</span> the_excerpt<span
class="br0">&#40;</span><span
class="br0">&#41;</span><span
class="sy0">;</span> <span
class="kw2">?&gt;</span></div></li><li
class="li1"><div
class="de1"><span
class="sy0">&lt;/</span>div<span
class="sy0">&gt;&lt;!&#8211;</span> <span
class="sy0">.</span>featured<span
class="sy0">-</span>post <span
class="sy0">&#8211;&gt;</span></div></li></ol></div><p>Of course, we&#8217;ll then need to sandwich that in our query, so we end up with the following:</p><div
class="geshi no php"><ol><li
class="li1"><div
class="de1"><span
class="kw2">&lt;?php</span></div></li><li
class="li1"><div
class="de1">&nbsp; &nbsp; <span
class="re1">$featured</span> <span
class="sy0">=</span> <span
class="kw2">new</span> WP_Query<span
class="br0">&#40;</span><span
class="br0">&#41;</span><span
class="sy0">;</span></div></li><li
class="li1"><div
class="de1">&nbsp; &nbsp; <span
class="re1">$featured</span><span
class="sy0">-&gt;</span><span
class="me1">query</span><span
class="br0">&#40;</span><span
class="st0">&#39;posts_per_page=3&amp;category_name=Featured&amp;orderby=rand&#39;</span><span
class="br0">&#41;</span><span
class="sy0">;</span></div></li><li
class="li1"><div
class="de1"><span
class="kw2">?&gt;</span></div></li><li
class="li1"><div
class="de1"><span
class="kw2">&lt;?php</span> <span
class="kw1">while</span> <span
class="br0">&#40;</span><span
class="re1">$featured</span><span
class="sy0">-&gt;</span><span
class="me1">have_posts</span><span
class="br0">&#40;</span><span
class="br0">&#41;</span><span
class="br0">&#41;</span> <span
class="sy0">:</span> <span
class="re1">$featured</span><span
class="sy0">-&gt;</span><span
class="me1">the_post</span><span
class="br0">&#40;</span><span
class="br0">&#41;</span><span
class="sy0">;</span> <span
class="kw2">?&gt;</span></div></li><li
class="li1"><div
class="de1">&nbsp;</div></li><li
class="li1"><div
class="de1"><span
class="sy0">&lt;</span>div <span
class="kw2">class</span><span
class="sy0">=</span><span
class="st0">&quot;featured-post&quot;</span><span
class="sy0">&gt;</span></div></li><li
class="li1"><div
class="de1">&nbsp;<span
class="sy0">&lt;</span>h2<span
class="sy0">&gt;&lt;</span>a href<span
class="sy0">=</span><span
class="st0">&quot;&lt;?php the_permalink(); ?&gt;&quot;</span><span
class="sy0">&gt;&lt;</span>?php the_title<span
class="br0">&#40;</span><span
class="br0">&#41;</span><span
class="sy0">;</span> ?<span
class="sy0">&gt;&lt;/</span>a<span
class="sy0">&gt;&lt;/</span>h2<span
class="sy0">&gt;</span></div></li><li
class="li1"><div
class="de1">&nbsp;<span
class="kw2">&lt;?php</span> the_excerpt<span
class="br0">&#40;</span><span
class="br0">&#41;</span><span
class="sy0">;</span> <span
class="kw2">?&gt;</span></div></li><li
class="li1"><div
class="de1"><span
class="sy0">&lt;/</span>div<span
class="sy0">&gt;&lt;!&#8211;</span> <span
class="sy0">.</span>featured<span
class="sy0">-</span>post <span
class="sy0">&#8211;&gt;</span></div></li><li
class="li1"><div
class="de1">&nbsp;</div></li><li
class="li1"><div
class="de1"><span
class="kw2">&lt;?php</span> <span
class="kw1">endwhile</span><span
class="sy0">;</span> <span
class="kw2">?&gt;</span></div></li></ol></div><div
class="alert">By adding the div within the loop, this runs it for every post so that each post is wrapped in the class featured-post.</div><h2>Styling the featured content</h2><p>Next a little styling. Nettus <a
href="http://net.tutsplus.com/tutorials/html-css-techniques/quick-tip-practical-css-shapes/">recently published</a> a screencast showing how to make the fold over (that&#8217;s actually a triangle) effect purely with CSS. We&#8217;ll be using that technique here to give a little pop to our featured content. We&#8217;ll also be employing some subtle CSS3 shadows and gradients to subtly make our content <em>look awesome</em>.</p><p>First, we need to wrap the whole lot in a div and give that a width, background etc:</p><div
class="geshi no css"><ol><li
class="li1"><div
class="de1"><span
class="re0">#welcome</span><span
class="br0">&#123;</span> position<span
class="re2">:relative</span><span
class="sy0">;</span> margin<span
class="re2">:<span
class="nu0">0</span></span><span
class="sy0">;</span> <span
class="kw1">background</span><span
class="sy0">:</span> <span
class="re0">#EAEAEA</span><span
class="sy0">;</span></div></li><li
class="li1"><div
class="de1">height<span
class="re2">:<span
class="re3">180px</span></span><span
class="sy0">;</span> padding<span
class="re2">:<span
class="re3">20px</span></span> <span
class="re3">20px</span> <span
class="re3">20px</span> <span
class="re3">40px</span><span
class="sy0">;</span> width<span
class="re2">:<span
class="re3">662px</span></span><span
class="sy0">;</span></div></li><li
class="li1"><div
class="de1">text-shadow<span
class="re2">:<span
class="re3">1px</span></span> <span
class="re3">1px</span> <span
class="re3">1px</span> <span
class="re0">#fff</span><span
class="sy0">;</span> margin<span
class="re2">:<span
class="nu0">0</span></span> <span
class="nu0">0</span> <span
class="nu0">0</span> -<span
class="re3">20px</span><span
class="sy0">;</span></div></li><li
class="li1"><div
class="de1">-webkit-box-shadow<span
class="sy0">:</span> <span
class="re3">1px</span> <span
class="re3">1px</span> <span
class="re3">3px</span> <span
class="re0">#<span
class="nu0">292929</span></span><span
class="sy0">;</span></div></li><li
class="li1"><div
class="de1">-moz-box-shadow<span
class="sy0">:</span> <span
class="re3">1px</span> <span
class="re3">1px</span> <span
class="re3">3px</span> <span
class="re0">#<span
class="nu0">292929</span></span><span
class="sy0">;</span> <span
class="br0">&#125;</span></div></li></ol></div><p>In addition to the CSS3 box shadow we&#8217;ve got, you might like to add some CSS3 gradients to the box, something like this looks subtly awesome!</p><div
class="geshi no css"><ol><li
class="li1"><div
class="de1"><span
class="kw1">background</span><span
class="sy0">:</span> -webkit-gradient<span
class="br0">&#40;</span>linear,<span
class="kw1">left</span> <span
class="kw1">top</span>,<span
class="kw1">left</span> <span
class="kw1">bottom</span>,from<span
class="br0">&#40;</span><span
class="re0">#fff</span><span
class="br0">&#41;</span>,to<span
class="br0">&#40;</span><span
class="re0">#C9C9C9</span><span
class="br0">&#41;</span>,color-stop<span
class="br0">&#40;</span><span
class="nu0">1</span>,<span
class="re0">#C9C9C9</span><span
class="br0">&#41;</span><span
class="br0">&#41;</span> <span
class="kw2">fixed</span> <span
class="kw2">no-repeat</span> <span
class="nu0">0</span> <span
class="re3"><span
class="nu0">100</span>%</span><span
class="sy0">;</span></div></li><li
class="li1"><div
class="de1"><span
class="kw1">background</span><span
class="sy0">:</span> -moz-linear-gradient<span
class="br0">&#40;</span><span
class="re3"><span
class="nu0">100</span>%</span> <span
class="re3"><span
class="nu0">100</span>%</span> 90deg, <span
class="re0">#C9C9C9</span>, <span
class="re0">#FFF</span><span
class="br0">&#41;</span> <span
class="kw2">fixed</span> <span
class="kw2">no-repeat</span> <span
class="nu0">0</span> <span
class="re3"><span
class="nu0">100</span>%</span><span
class="sy0">;</span></div></li></ol></div><p>We can then add a little styling to the .welcome-post class we created to wrap each post with:</p><div
class="geshi no css"><ol><li
class="li1"><div
class="de1"><span
class="re1">.welcome-post</span> <span
class="br0">&#123;</span> width<span
class="re2">:<span
class="re3">200px</span></span><span
class="sy0">;</span> padding<span
class="re2">:<span
class="nu0">0</span></span> <span
class="re3">20px</span> <span
class="nu0">0</span> <span
class="nu0">0</span><span
class="sy0">;</span> float<span
class="re2">:left</span><span
class="sy0">;</span><span
class="br0">&#125;</span></div></li></ol></div><p>This&#8217;ll split up the area into three little columns, one for each post.</p><p>We can then style links and H2s:</p><div
class="geshi no css"><ol><li
class="li1"><div
class="de1"><span
class="re0">#welcome</span> h2<span
class="br0">&#123;</span> font-family<span
class="re2">:arial</span><span
class="sy0">;</span> border-bottom<span
class="re2">:dashed</span> <span
class="re3">1px</span> <span
class="re0">#aaa</span><span
class="sy0">;</span> <span
class="kw1">padding</span><span
class="sy0">:</span> <span
class="nu0">0</span> <span
class="nu0">0</span> <span
class="re3">10px</span><span
class="sy0">;</span> <span
class="br0">&#125;</span></div></li><li
class="li1"><div
class="de1"><span
class="re0">#welcome</span> a<span
class="re2">:hover</span><span
class="br0">&#123;</span> <span
class="kw1">color</span><span
class="sy0">:</span><span
class="re0">#<span
class="nu0">444</span></span><span
class="sy0">;</span> <span
class="br0">&#125;</span></div></li></ol></div><p>And again, some optional CSS3 enhancement:</p><div
class="geshi no css"><ol><li
class="li1"><div
class="de1"><span
class="re0">#welcome</span> a<span
class="br0">&#123;</span> -webkit-transition<span
class="sy0">:</span> all <span
class="nu0">0</span><span
class="re1">.2s</span> ease-in-out<span
class="sy0">;</span> -moz-transition<span
class="sy0">:</span> all <span
class="nu0">0</span><span
class="re1">.2s</span> ease-in-out<span
class="sy0">;</span> <span
class="br0">&#125;</span></div></li></ol></div><p>Finally, we just need to add the little arrow:</p><div
class="geshi no css"><ol><li
class="li1"><div
class="de1"><span
class="re1">.arrow</span> <span
class="br0">&#123;</span> <span
class="kw1">border-left</span><span
class="sy0">:</span> <span
class="re3">20px</span> <span
class="kw2">solid</span> <span
class="kw2">transparent</span><span
class="sy0">;</span></div></li><li
class="li1"><div
class="de1"><span
class="kw1">border-top</span><span
class="sy0">:</span> <span
class="re3">10px</span> <span
class="kw2">solid</span> <span
class="re0">#3E8AAD</span><span
class="sy0">;</span> <span
class="kw1">height</span><span
class="sy0">:</span> <span
class="re3">0px</span><span
class="sy0">;</span> <span
class="kw1">left</span><span
class="sy0">:</span> <span
class="re3">0px</span><span
class="sy0">;</span></div></li><li
class="li1"><div
class="de1"><span
class="kw1">line-height</span><span
class="sy0">:</span> <span
class="nu0">0</span><span
class="sy0">;</span> <span
class="kw1">position</span><span
class="sy0">:</span> <span
class="kw2">absolute</span><span
class="sy0">;</span> <span
class="kw1">top</span><span
class="sy0">:</span> <span
class="re3">221px</span><span
class="sy0">;</span> <span
class="kw1">width</span><span
class="sy0">:</span> <span
class="re3">0px</span><span
class="sy0">;</span> <span
class="br0">&#125;</span></div></li></ol></div><p>And we&#8217;ve created an awesome featured content area. You can grab the source files below and just <a
href="http://wpshout.com">check out the homepage</a> for an example.</p><p
style="text-align: center;"><a
class="button" href="http://wpshout.com/downloads/featured-area.zip">Download</a></p> ]]></content:encoded> <wfw:commentRss>http://wpshout.com/featured-content-wordpress/feed/</wfw:commentRss> <slash:comments>14</slash:comments> </item> <item><title>Drop Caps For WordPress</title><link>http://wpshout.com/drop-caps-for-wordpress/</link> <comments>http://wpshout.com/drop-caps-for-wordpress/#comments</comments> <pubDate>Mon, 19 Apr 2010 14:00:20 +0000</pubDate> <dc:creator>Alex Denning</dc:creator> <category><![CDATA[Theme Design]]></category><guid
isPermaLink="false">http://wpshout.com/?p=2583</guid> <description><![CDATA[Drop caps are a really simple way of making your posts just that bit more interesting. They're easy to do too - in this post we'll find out how we can use a mixture of CSS3 and plugins in order to spark up posts with minimum effort.]]></description> <content:encoded><![CDATA[<p>Drop caps are a really simple way of making your posts <em>just that bit more interesting</em>. They&#8217;re easy to do too &#8212; in this post we&#8217;ll find out how we can use a mixture of CSS3 and plugins in order to spark up posts <em>with minimum effort.</em></p><h2>Drop cap first letter</h2><p>Drop caps are when you take the first letter and enlarge it, dropping it down several lines and wrapping text around it so that it looks something like this (you&#8217;ve probably seen it before, even if you didn&#8217;t recognise it):</p><p><a
href="http://wpshout.com/media/2010/04/drop-cap.jpg"><img
class="alignnone size-full wp-image-2585" title="drop-cap" src="http://wpshout.com/media/2010/04/drop-cap.jpg" alt="" width="640" height="300" /></a></p><div
class="alert">There are three ways of doing this. One is use a plugin, the other is use CSS3 and the final one is do it manually. The only way which adds no extra markup is the CSS3, but that doesn&#8217;t work cross browser. The plugin way is best if you want to add drop caps to all your posts and if it&#8217;s just the occasional post then the manual way it best.</div><h3>The plugin way</h3><p>We&#8217;ll start with the plugin method. The appropriately named &#8216;<a
href="http://wordpress.org/extend/plugins/drop-caps/">Drop Caps</a>&#8216; plugin adds &lt;span&gt; around the first letter of the post which you can then style as you wish.</p><table
style="width: 640px;" border="0"><tbody><tr><td>Pros</td><td>Cons</td></tr><tr><td>Install it and forget about it</td><td>Adds extra markup</td></tr><tr><td>Works in all browsers</td><td
rowspan="2">You don&#8217;t need a plugin for everything, rather goes against that idea</td></tr><tr><td>Gives some options</td></tr></tbody></table><h3>The CSS3 way</h3><p>You can use CSS3&#8242;s selectors to do this, specifically the <code>:first-letter</code> and <code>:first-of-type</code>. Combining these together you can target the first letter of the first paragraph of your post&#8217;s content:</p><div
class="geshi no css"><div
class="head">Drop cap the CSS3 way</div><ol><li
class="li1"><div
class="de1"><span
class="re1">.post</span> p<span
class="re2">:first-of-type</span><span
class="re2">:first-letter</span><span
class="br0">&#123;</span></div></li><li
class="li1"><div
class="de1">&nbsp;<span
class="kw1">font-size</span><span
class="sy0">:</span> <span
class="re3">48px</span><span
class="sy0">;</span></div></li><li
class="li1"><div
class="de1">&nbsp;<span
class="kw1">padding</span><span
class="sy0">:</span> <span
class="re3">10px</span><span
class="sy0">;</span></div></li><li
class="li1"><div
class="de1">&nbsp;<span
class="kw1">float</span><span
class="sy0">:</span> <span
class="kw1">left</span><span
class="sy0">;</span></div></li><li
class="li1"><div
class="de1"><span
class="br0">&#125;</span></div></li></ol></div><p>These mean you don&#8217;t need to add any extra markup whatsoever to the post and it&#8217;ll be all automated for you. The downside, of course, is that IE users don&#8217;t get to see the drop cap, but it <em>does</em> degrade gracefully:</p><table
border="0"><tbody><tr><td>Pros</td><td>Cons</td></tr><tr><td>No extra markup</td><td>Doesn&#8217;t work cross browser</td></tr><tr><td>Requires very little effort &#8212; it just works!</td><td>I&#8217;ve found text can&#8217;t be selected when using this technique</td></tr><tr><td>Degrades gracefully</td><td></td></tr></tbody></table><h3>The manual way</h3><p>If you only want to use a drop cap on the occasional post then this is the best way of doing things &#8212; otherwise I can see very little advantage in doing this over any of the other methods.</p><p>The manual way does mean wrapping the first letter of the post in &lt;span&gt; tags in the HTML editor. This means unless you do it <em>from the start</em> on your blog you&#8217;re not going to get the drop cap on every post, hence why I wouldn&#8217;t really recommend doing this unless you only want to do it occasionally.</p><p>You&#8217;ll need some CSS, something like this:</p><div
class="geshi no css"><div
class="head">Drop cap the manual way</div><ol><li
class="li1"><div
class="de1"><span
class="re1">.post</span> span<span
class="br0">&#123;</span></div></li><li
class="li1"><div
class="de1">&nbsp;<span
class="kw1">font-size</span><span
class="sy0">:</span> <span
class="re3">48px</span><span
class="sy0">;</span></div></li><li
class="li1"><div
class="de1">&nbsp;<span
class="kw1">padding</span><span
class="sy0">:</span> <span
class="re3">10px</span><span
class="sy0">;</span></div></li><li
class="li1"><div
class="de1">&nbsp;<span
class="kw1">float</span><span
class="sy0">:</span> <span
class="kw1">left</span><span
class="sy0">;</span></div></li><li
class="li1"><div
class="de1"><span
class="br0">&#125;</span></div></li></ol></div><table
style="width: 600px;" border="0"><tbody><tr><td>Pros</td><td>Cons</td></tr><tr><td>Works cross browser</td><td>Won&#8217;t work in retrospect</td></tr><tr><td>Gives you complete control over which posts have the dropcap</td><td>Adds extra markup</td></tr><tr><td></td><td>Does mean a bit of effort wrapping the first letter of the post in a &lt;span&gt; tag.</td></tr></tbody></table><h2>Dropping off?</h2><p>Wake up! It&#8217;s the end of the post. That&#8217;s a really bad pun. I&#8217;d better end quickly. Drop caps. They&#8217;re pretty cool and now they&#8217;re easy for you to do too. Do leave a comment if you&#8217;ve got an ingenious better way of doing this.</p><p><em>Image from <a
href="http://dailydropcap.com/">DailyDropCap</a>, an awesome site.</em></p> ]]></content:encoded> <wfw:commentRss>http://wpshout.com/drop-caps-for-wordpress/feed/</wfw:commentRss> <slash:comments>7</slash:comments> </item> <item><title>Premium Frameworks Reviewed</title><link>http://wpshout.com/premium-frameworks-reviewed/</link> <comments>http://wpshout.com/premium-frameworks-reviewed/#comments</comments> <pubDate>Mon, 15 Mar 2010 14:00:36 +0000</pubDate> <dc:creator>Alex Denning</dc:creator> <category><![CDATA[Theme Design]]></category><guid
isPermaLink="false">http://wpshout.com/?p=2084</guid> <description><![CDATA[Of late commercial frameworks have started appearing everywhere. This post will try and make sense of it all, comparing Frugal, Headway, Builder, Genesis and Elemental. That's all the commercial frameworks I could think of bar Thesis, who didn't reply to me emails. This is an unbiased, unaffiliated look at what your options are if you want something to build more WordPress sites off.]]></description> <content:encoded><![CDATA[<p>Of late commercial frameworks have started appearing everywhere. This post will try and make sense of it all, comparing <a
href="http://bit.ly/9rFah6">Frugal</a>, <a
href="http://bit.ly/9FnogI">Headway</a>, <a
href="http://ithemes.com">Builder</a>, <a
href="http://bit.ly/cAsWmU">Genesis </a>and <a
href="http://bit.ly/cvBZ91">Elemental</a>. That&#8217;s all the commercial frameworks I could think of bar Thesis, who didn&#8217;t reply to me emails. This is an unbiased, unaffiliated look at what your options are if you want something to build more WordPress sites off.</p><p><em>Update 06-04-2010 &#8212; I&#8217;ve added in affiliate links as regular readers will have read the article by now, but the content remains the same.</em></p><h2>Frugal</h2><p>Initial impressions are good. A hefty user guide covers most things although a quick video introduction to the theme would have been useful. Installation goes smoothly and I&#8217;m all set with a decent looking site from the off.</p><p>Frugal&#8217;s big selling point is it&#8217;s options pages. These offer you a huge array of different options for changing the look and feel of your site. In a couple of minutes I was able to make a respectable looking site which was impressive.</p><p>Asides from the theme options, Frugal offers the usual in post SEO options and a whole load of custom hooks.</p><p>Who&#8217;s this for? I&#8217;d say it&#8217;s a better option that Thesis for most, and Eric Hamm, Frugal founder agrees with me (he also thinks that everyone, everywhere should be using it though!):</p><blockquote><p>I see all kinds of people use my theme.  From total beginners to seasoned WP developers. Usually, though, it seems to be people who don&#8217;t want to mess with much coding, but who still want to do-it-all with their theme.</p></blockquote><p
style="text-align: left;">Summing up, really comprehensive options pages let you change pretty heftily the design. I fear though that if you don&#8217;t know a lot about design then you&#8217;d find the options overwhelming and not know what to change.</p><h2>Headway</h2><p>Wow. Headway&#8217;s got a visual editor that&#8217;s not like anything I&#8217;ve ever seen in a WordPress theme.</p><blockquote><p>Headway is visual.  You edit and customize the theme right before your eyes.  We use a system that consists of &#8220;leafs&#8221;.  Leafs can be compared to widgets, but you can move a leaf almost anywhere on the page.  You can also have sidebar leafs that allow you to add widgets.  The sky is the limit.</p></blockquote><p>That&#8217;s Headway&#8217;s Clay Griffiths. He&#8217;s not far wrong actually. Headway has a visual editor overlay thing that lets you quite literally drag bits around your page. If you want a block wider you can either set the width or just drag it across the page! It&#8217;s very well done &#8211; you can hover over an element to find its class or ID, click on elements to change them etc etc. A video would explain this better, so I&#8217;ve just made one. I didn&#8217;t narrate it as I didn&#8217;t really have any idea what I was doing &#8211; I was just playing around <img
src='http://wpshout.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><p>Headway also has things like the colour pickers, options pages, all the things you&#8217;d expect from a premium theme. I&#8217;m impressed, but would I actually use it? I&#8217;m not sure I would. I don&#8217;t think you&#8217;d ever be able to create something really nice and unique by dragging and dropping. Some might find it&#8217;s a good option, but for most I think it&#8217;s a bit too gimmicky.</p><h2>Builder</h2><p>Builder has a page that lets you&#8230; well, build pages in a way similar to Headway&#8217;s visual editor.</p><p>It&#8217;s not quite as innovative as Headway &#8211; no drag and drop here, but the interface is functional &#8211; select a &#8216;module&#8217; &#8211; be it navigation, widget bar, content area, footer etc and where you want it and you&#8217;ve built a layout. You can then choose to apply this to a page, post or homepage. You&#8217;ve got control over the layout but not really the design which I&#8217;m not sure isn&#8217;t a bad thing &#8211; with Frugal and Headway I get the idea you&#8217;ll see largely the same sites being churned &#8211; there&#8217;s only so far you can get with their options I think.</p><p>Other nice touches include things like a menu manager (although it&#8217;s nothing like the 3.0 manager!) and a couple of SEO options. It also has iThemes&#8217; impressive array of video tutorials which cover most things I can think of from changing your permalink structure to creating a post. As with the others, it offers what you&#8217;d expect from a decent quality premium theme.</p><p>It&#8217;s right up with Headway with the whole build pages idea and between the two I&#8217;d probably go with Builder &#8211; it doesn&#8217;t offer nearly the same <em>design</em> options, but for building layouts, it&#8217;s pretty good and my favourite out of Frugal and Headway.</p><h2>And now for something completely different</h2><p>You&#8217;ll only be able to get <em>so far</em> with any of Headway, Frugal or Builder before you have to actually start writing some code. No matter what you do with any of these themes, with the built in options, they&#8217;ll still have some features that point them out as powered by that theme. They&#8217;re all good for people who <em>can&#8217;t</em> write code, but you&#8217;ll only get so far editing them and no way are these going to be the death of the good old well designed <em>and then coded</em> theme.</p><p>The second half of this post will look at two &#8216;frameworks&#8217; that more or less exclusively designed for building new designs. Introducing Genesis and Elemental.</p><h2>Genesis and Elemental</h2><p>From StudioPress, Brian and Nathan did a pretty damn good job of presenting Genesis as the be all and end all of frameworks. On installation I was impressed with the options page that isn&#8217;t covered in jQuery, but actually looks nice and blends in with the WordPress backend. The big focus though is on child themes. Genesis has been presented as something that you can build all kinds of sites off and it&#8217;ll function great regardless. Hooks and filters all over the place, they&#8217;ve certainly nailed those. The SEO options are comprehensive too, I&#8217;ll give them that as well. I&#8217;m going to come back to Genesis in a sec. First, Elemental.</p><p>Elemental is from ProThemeDesign. It&#8217;s certainly a turn away from the likes of Mimbo and if I&#8217;m honest I had pretty high expectations of it. Ben&#8217;s work is always awesome so something that was originally built <em>for him</em> has got to be pretty good, I thought. On installation I instantly took a shone to Elemental. I don&#8217;t know why, but I got the impression that if I was going to build all my themes off something, then this would be it.</p><p>In a framework like this, it&#8217;s the attention to detail that matters and Genesis might win on the development side, but the little touches like a bar at the top of all pages with quick links to writing posts, pages and the dashboard make me lean towards Elemental as something I&#8217;d actually <em>like</em> to use day in, day out.</p><p>Between the two, Genesis is certainly well made, but then so is Elemental. The Genesis options page fits in really nicely but the Elemental one looks good too. It&#8217;s tough to choose between the two; they both offer similar awesome page templates, options pages, filters and hooks. There is one difference though that separates the two. Genesis offers a theme store which lets you buy child themes but Elemental doesn&#8217;t. For me, it&#8217;s not a problem, but if you don&#8217;t want to build a design from scratch then Genesis should be the one to go for. If you want something to build all your sites with then go for Elemental as it&#8217;s a pleasure to use.</p><h2>Could you concise that?</h2><p>Sure. Frugal has a huge options panel which is good for those of you who want something they can customise a bit but ultimately you want a blog look. Headway is like Frugal with layout options added on. Builder is what Frugal would be if it did layout options instead of design options.</p><p>Genesis and Elemental are both very well built but the deciding factor is whether you want to be able to buy child themes (note theme<strong><em>s<span
style="font-weight: normal;"> &#8211; <span
style="font-style: normal;">you can buy them for Elemental from ProThemeDesign). If you do, go for Genesis, but if not Elemental.</span></span></em></strong></p> ]]></content:encoded> <wfw:commentRss>http://wpshout.com/premium-frameworks-reviewed/feed/</wfw:commentRss> <slash:comments>16</slash:comments> </item> <item><title>HTML to WordPress Case Study</title><link>http://wpshout.com/html-to-wordpress-case-study/</link> <comments>http://wpshout.com/html-to-wordpress-case-study/#comments</comments> <pubDate>Thu, 25 Feb 2010 12:00:54 +0000</pubDate> <dc:creator>Alex Denning</dc:creator> <category><![CDATA[Basics]]></category> <category><![CDATA[Theme Design]]></category><guid
isPermaLink="false">http://wpshout.com/?p=2231</guid> <description><![CDATA[Converting HTML to WordPress has just got easier with this post 'case study' looking at a real world example of the DesignInformer redesign.]]></description> <content:encoded><![CDATA[<p>Following on from Monday&#8217;s introduction to WordPress <a
href="http://wpshout.com/wordpress-theme-design-basics/"target="_blank"title="WordPress Theme Design Basics" >theme design</a>, today we&#8217;ll be looking at the recent DesignInformer redesign; how the HTML to WordPress process went with what was quite a classic blog look.</p><p>It all started when Jad sent me a Google Chat message asking if I&#8217;d help him with converting an HTML design to WordPress. I then ended up doing the whole theme. I still don&#8217;t know how that happened. Over the next couple of weeks, Jad then revisited the theme, doing it again himself &#8212; the best way of learning!</p><p>The first thing to do was to take the HTML and <a
href="http://wpshout.com/wordpress-theme-design-basics/#part-3">put it into</a> header, index, sidebar and footer files. Here&#8217;s a badly made screenshot of which bits went where:</p><p><a
href="http://wpshout.com/media/2010/02/sidebar-header-footer.jpg"><img
class="alignnone size-full wp-image-2234" title="sidebar-header-footer" src="http://wpshout.com/media/2010/02/sidebar-header-footer.jpg" alt="" width="590" height="938" /></a></p><p>Nothing here is too taxing for WordPress to handle, but a couple of things pose a problem.</p><h2>The header</h2><p>As the design was only going to be used on DesignInformer, there was no need to make the navigation dynamic. The same applied to the logo, RSS and Twitter buttons, so nothing really to do here!</p><h2>The index</h2><p>I&#8217;m using the index and not the home file here as we&#8217;re creating something that <em>can </em>be used as a fallback. A closer look at the post area reveals it&#8217;s quite complex. WordPress brain in gear, these were what I thought I&#8217;d do (another poorly made graphic!):</p><p><a
href="http://wpshout.com/media/2010/02/index.jpg"><img
class="alignnone size-full wp-image-2235" title="index" src="http://wpshout.com/media/2010/02/index.jpg" alt="" width="590" height="525" /></a></p><p>Looking at the CSS though, we hit a problem. Quite a few problems actually. First is that the excerpt is a paragraph with a class. the_excerpt outputs plain <code>&lt;p&gt;</code>s. An ingenious solution is at hand though: <code>the_excerpt_rss</code> <em>doesn&#8217;t </em>have any wrapping <code>&lt;p&gt;</code>s so we can apply our own styling:</p><pre><code>&lt;p class="excerpt"&gt;&lt;?php the_excerpt_rss(); ?&gt;&lt;/p&gt;
</code></pre><p>The next problem is the &#8216;Continue Reading&#8217; section. That too has a class so we can&#8217;t just use the read more that comes with <code>the_excerpt</code>. Instead, we can use <code>&lt;?php the_permalink(); ?&gt;</code> and wrap the continue reading <code>&lt;p class&gt;</code> around that:</p><pre><code>&lt;p class="read-more"&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;Continue Reading&lt;/a&gt;&lt;/p&gt;
</code></pre><p>I then found out that Jad wanted backwards comparability with his old posts which were using custom fields, not the post_thumbnail function. The solution was to use Justin Tadlock&#8217;s <a
href="http://justintadlock.com/archives/2008/05/27/get-the-image-wordpress-plugin">get_the_image</a> plugin, albeit customised a bit.</p><h2>The sidebar</h2><p>Badly made graphic number one is actually quite heavily cropped so you don&#8217;t see the &#8216;Popular Posts&#8217; section of the sidebar. For this, we followed my own advice to get most commented posts <a
href="http://wpshout.com/most-commented-posts-the-right-way-in-wordpress/">the right way</a>:</p><pre><code>&lt;ul&gt;
&lt;?php $popular = new WP_Query('orderby=comment_count&amp;posts_per_page=5'); ?&gt;
	&lt;?php while ($popular-&gt;have_posts()) : $popular-&gt;the_post(); ?&gt;	

	&lt;li&gt;&lt;a href="&lt;?php the_permalink() ?&gt;" rel="bookmark" title="&lt;?php the_title_attribute(); ?&gt;"&gt;&lt;?php the_title(); ?&gt; (&lt;?php comments_number('0','1','%'); ?&gt;)&lt;/a&gt;&lt;/li&gt;

&lt;?php endwhile; ?&gt;
&lt;/ul&gt;</code></pre><p>The rest of the sidebar is filled with ads and a latest tweets section which I left Jad to do via a plugin.</p><h2>The footer</h2><p>I largely left the footer as is &#8212; the Categories section was better left hardcoded as we didn&#8217;t want all of the categories, the friends list can be easily edited manually and the bottom of the footer is static too. That leaves the recommended reading section. A custom query is in order. We want two posts from the category with an ID of 164, so use the following code:</p><pre><code>&lt;ul&gt;
&lt;?php $reading = new WP_Query('cat=164&amp;posts_per_page=2'); ?&gt;

	&lt;?php while ($reading -&gt;have_posts()) : $reading -&gt;the_post(); ?&gt;	

	&lt;a href="&lt;?php the_permalink() ?&gt;" rel="bookmark" title="&lt;?php the_title_attribute(); ?&gt;"&gt;&lt;?php the_title(); ?&gt; (&lt;?php comments_number('0','1','%'); ?&gt;)&lt;/a&gt;

&lt;?php the_content(); ?&gt;

&lt;?php endwhile; ?&gt;
&lt;/ul&gt;</code></pre><p>We can use <code>the_content</code> as the whole post is being displayed &#8211; they&#8217;re only short!</p><h2>Lessons learnt</h2><p>The major lesson learnt here is that knowing your template tags can get you out of a lot of holes! Not knowing the_excerpt_rss could be used to get our p class could have meant you&#8217;d added in an extra div in an attempt to sort it out when you needn&#8217;t have done! Hopefully this case study will have helped you see in a real example how converting HTML to WordPress is easy!</p> ]]></content:encoded> <wfw:commentRss>http://wpshout.com/html-to-wordpress-case-study/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Basics Of WordPress Theme Design</title><link>http://wpshout.com/wordpress-theme-design-basics/</link> <comments>http://wpshout.com/wordpress-theme-design-basics/#comments</comments> <pubDate>Mon, 22 Feb 2010 12:00:34 +0000</pubDate> <dc:creator>Alex Denning</dc:creator> <category><![CDATA[Basics]]></category> <category><![CDATA[Theme Design]]></category><guid
isPermaLink="false">http://wpshout.com/?p=2131</guid> <description><![CDATA[The basics of WordPress theme design looks at the fundamental knowledge you need to start creating your own WordPress themes from scratch.]]></description> <content:encoded><![CDATA[<p>Originally posted a while ago, this tutorial series hasn&#8217;t really been receiving the attention it deserves. Here I&#8217;ve revisited it a bit and posted the whole lot in one go. Enjoy!</p><p>WordPress theme development is <em>actually</em> very hard. In this post we&#8217;ll look at the different aspects of WordPress theme development, starting with the fundamentals and then moving swiftly onto the basics, template tags and the more advanced files.</p><h2>Contents</h2><ul><li><a
href="http://wpshout.com/wordpress-theme-design-basics/#part-1">Part 1</a>: Introduction; the fundamentals of WordPress theme development</li><li><a
href="http://wpshout.com/wordpress-theme-design-basics/#part-2">Part 2</a>: The index.php and style.css files: the most important parts of any theme.</li><li><a
href="http://wpshout.com/wordpress-theme-design-basics/#part-3">Part 3</a>: The header.php, sidebar.php and footer.php files.</li><li><a
href="http://wpshout.com/wordpress-theme-design-basics/#part-4">Part 4</a>: The single.php file: the file that handles posts.</li><li><a
href="http://wpshout.com/wordpress-theme-design-basics/#part-5">Part 5</a>: The archive.php, home.php and functions.php files.</li></ul><h2>Downloads</h2><p>Part 2 onwards all have an accompanying download &#8211; they&#8217;re listed here:</p><ul><li><a
href="http://wpshout.com/downloads/beginnersguideday2.zip">Part 2</a></li><li><a
href="http://wpshout.com/downloads/beginnersguideday3.zip">Part 3</a></li><li><a
href="http://wpshout.com/downloads/beginnersguideday4.zip">Part 4</a></li><li><a
href="http://wpshout.com/downloads/beginnersguideday5.zip">Part 5</a></li></ul><p><a
name="part-1"></a></p><h2>THE FUNDAMENTALS</h2><p>A WordPress theme is made up of a number of different files, and they all contain a seperate section of the page; the header will contain the title and navigation, then the index will contain the main content area (or on a post, the single file does the job). The sidebar, obviously contains the sidebar and the footer contains the footer and closes off the HTML. This all sounds very straightforward, but the important bit is how you can just have a single file, change it once and you will change your whole site. Change your footer and that change will be reflected sitewise, not just on a single page.</p><p>Expanding on this, a post page is made up of four files (usually): the header.php file for the header, the single.php file for the post content, the sidebar.php file for the sidebar and the footer.php file for the footer. You can have the same header.php, sidebar.php and footer.php files for the whole site, and so when you make a change, this change comes immediately sitewide.</p><h2>THE ADMIN STUFF</h2><p>Getting started with WordPress theming can be a daunting prospect, and before we start, I&#8217;ll say this now; I&#8217;m going to assume a good solid understanding of both CSS and HTML. Good places to gain this knowledge are <a
href="http://css-tricks.com/video-screencasts/58-html-css-the-very-basics/">CSS-Tricks</a> and <a
href="http://net.tutsplus.com">Nettuts</a>+.</p><p>A couple of things to sort out first &#8211; you&#8217;ll need to get yourself a code editor. If you&#8217;re using Windows, the free <a
href="http://notepad-plus.sourceforge.net/uk/site.htm">Notepad++</a> is an excellent tool to have and if you&#8217;re on a Mac then I&#8217;m sure there are plenty of great free editors, but the one that everyone raves about is called <a
href="http://www.panic.com/coda/">Coda</a>(and it&#8217;s not free). If you&#8217;re serious about design then Coda will be worth it in the long term. The only other quick thing we need to do is install WordPress locally. You can find how to do that <a
href="http://wpshout.com/how-to-install-wordpress-locally-in-windows/">here</a>.</p><p><a
name="part-2"></a></p><h2>Creating a basic theme</h2><p>First off, the style.css. This is our stylesheet. This isn’t a design series, so I’m not going to dwell on it too much, but there are some important parts of a stylesheet which WordPress needs that tell it some info about the theme. The theme we&#8217;ll be creating this week is called Champion. It&#8217;s based on the Default WordPress theme for ease of use. Download the theme and unzip it. Open up the style.css file and you&#8217;ll see something like this:</p><pre><code>/*
Theme Name: Champion Theme URI: http://wpshout.com
Description: description
Author: Alex Denning
Author URI: http://wpshout.com
Version: 1.0
*/</code></pre><p>And that&#8217;s all you need to make a stylesheet WordPress-ified. After you&#8217;ve got that in a stylesheet, you can style as you would normally.</p><h2>The index</h2><p>WordPress has lots of different template files. They&#8217;re all used to generate different types of post, page, archive etc. A previous post <a
href="http://wpshout.com/wordpress-template-file-hierarchy-explained/">explains all</a>, but to give you an idea</p><p>For posts, first, WordPress will look for the single.php file, but if it isn’t found then it will use the index.php to display the post.</p><p>For author archives, first WordPress will look for the author.php file, then the archive.php file and if it can’t find that it’ll use the index.php file to display the author archive. It’s the same with all types of post, page or archive; they all revert to the index.php. This is why it is the most important file of them all.</p><p>So let’s get started. Open up the theme files again and open the index.php file. We don&#8217;t need any other files because as I’ve just pointed out, all types of page revert back to the index.php file so to prove the point, in this part it is the only file we’re going to use. As the week goes on we’ll be adding more files back in, don’t worry! Open up the index.php file and look for line 49, which starts with:</p><pre><code>&lt;?php if (have_posts()) : ?&gt;

&lt;?php while (have_posts()) : the_post(); ?&gt;</code></pre><p>This is the WordPress Loop, and the most important part of any WordPress theme. This part is exciting; we’re using the most important template file and the most important part of any template file!</p><h2>THE LOOP EXPLAINED</h2><p>So what is this Loop? It’s the thing that goes and fetches posts. With the loop started, look at the next couple of lines, ignoring the opening &lt;div&gt;s. They read:</p><pre><code>&lt;h2&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;

&lt;?php the_content(); ?&gt;</code></pre><p>These are your very first template tags. Template tags are pieces of PHP (which always start and end &lt;?php and ?&gt;)  which tell WordPress for the current post, get this piece of information. For example, the first template tag used here, the_permalink, tells WordPress for the current post, get the post permalink. Used inside an anchor and you’ve got yourself a link to current post. The next template tag, the_title, as you might have guessed, outputs the title of the post. Add that all together, inside an H2 tag and you’ve got yourself a title which when clicks goes to the post’s post page.</p><p>The final template tag above is the_content. This is tells WordPress for the current post, go and find the contents of it and display it.</p><p>The next part of the file reads (again, ignoring the divs):</p><pre><code>&lt;?php endwhile; ?&gt;

&lt;php next_posts_link('' Older Entries') ?&gt;

&lt;?php previous_posts_link('Newer Entries &amp;raquo;') ?&gt;

&lt;?php else : ?&gt;

&lt;h2&gt;Not Found&lt;/h2&gt;

&lt;p&gt;Sorry, but you are looking for something that isn't here.&lt;/p&gt;

&lt;?php endif; ?&gt;</code></pre><p>The first part, endwhile tells WordPress when you’ve finished displaying all the posts, display this:. What is displayed are links to older and newer entries using the template tags next_posts_link and previous_posts_link.</p><p>The next part, else tells WordPress if you can’t find any posts, display this:. You’ll see that if no posts are found then a ‘Not Found’ displays. Finally, endif finishes the loop.</p><p>So there we have it; the most important part of any WordPress theme; the loop. What we’ve also done is get introduced to template tags. There are quite a few to get yourself familiar with, and you can find them listed on the <a
href="http://codex.wordpress.org/Template_Tags">codex</a>.</p><p>With the deciphering done, load up the theme to your WordPress install and activate it. You’ll see that despite only having a stylesheet and a single index.php file, the theme loads fine. Click on a post and you’ll see that gets displayed too. Pages, post archives, category archives and any page you like work fine too. Going back to what I said earlier – all template file hierarchies fall back on the index.php file – this proves it.</p><p>This also arises the question – “if I can do all this with a single file, why have more template files?” The answer is customisation. A change to the index.php file will be reflected throughout the entire site, so if you just want to change post pages then you wouldn’t be (easily, see à) able to do this, which is why we have different template files (the pedantic might point out you could get round this with if statements, which is true, but it wouldn’t be particularly practical at the end of the day).</p><p><a
name="part-3"></a></p><p><span
style="font-family: Georgia; line-height: normal; font-size: 24px; text-transform: uppercase;">SEPARATING the files</span></p><p>Download the latest copy of our theme and open up the index.php file. First thing that you should notice is that the header has been replaced with a piece of PHP -</p><pre><code>&lt;?php get_header(); ?&gt;.
</code></pre><p>This is another of WordPress’ template tags, and it’s telling WordPress go into the theme files, find the header.php file and display the contents here. As your <a
href="http://wpshout.com/category/themes/">theme </a>becomes more and more complicated, this allows you to create a single header and use it throughout your theme. At this point, you’re probably opening up the header.php file. Good idea! Upon opening it, you’ll see it’s the same thing we had starting off our index.php file. All that has changed is now it has a whole file to itself.</p><h2>DECIPERING THE HEADER</h2><p>Before we move on, a couple of important header points. You’ll notice that the header doesn’t display things like your content type, it uses template tags (I did say there were lots!) such as:</p><pre><code>&lt;?php bloginfo('html_type'); ?&gt;
</code></pre><p>When this loads, what is displayed is your HTML type – have a look at the source code yourself – text/html gets shown. Template tags such as this one are used throughout the header to get the stylesheet url, title, pingback url etc etc. The reason for this is because every WordPress installation is different and so by using dynamic template tags, you can cater for all of these different installations at once.</p><h2>THE SIDEBAR</h2><p>Look back in the index file and you’ll see that the sidebar has gone too, and its place &lt;?php get_sidebar(); ?&gt;. Like the header, this tells WordPress go into the theme files, find the sidebar.php file and display the contents here. There’s not much to decipher here; a couple of new template tags and only one completely new thing: widgets, which we’ll discuss further in the last part as it requires the functions.php file.</p><h2>THE FOOTER</h2><p>The final part of this part&#8217;s instalment is going to look at the footer. Like the header and sidebar, it has been removed from the index.php file and now resides in the footer.php file. Again, it is referenced with the &lt;?php get_footer(); ?&gt; function. Nothing much new here; again some more new template tags, but other than that it&#8217;s much the same as the index.php file&#8217;s footer we had before.</p><p><a
name="part-4"></a></p><h2>DEVELOPING THE SINGLE.PHP (POST PAGE) FILE</h2><p>Upon opening the single.php file, it should look pretty familiar; the first line is &lt;?php get_header(); ?&gt; which, as we learnt in the previous part, tells WordPress find the header.php file and display the contents here. Skip a line and you’ll see:</p><pre><code>&lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;
</code></pre><p>That too should look familiar; it’s the loop! Scroll down further and you’ll see a couple of template tags -</p><pre><code>&lt;?php the_title(); ?&gt;</code></pre><p>and</p><pre><code>&lt;?php the_content(); ?&gt;</code></pre><p>. After that, scroll down to line 35 and you’ll meet a new template tag:</p><pre><code>&lt;?php comments_template(); ?&gt;</code></pre><p>Just like get_header, get_sidebar and get_footer, this tells WordPress go and find the comments.php file and display the contents here.  You can probably guess where this is going – get the comments.php file open.</p><h2>GETTING TO GRIPS WITH WORDPRESS’ COMMENTS</h2><p>Open it up and&#8230; eek! It’s complicated. The comments file is notorious for being the thing that must be done but no-one really likes doing. But that isn’t going to stop us, is it? No. Let’s get going. The first part of the code just checks to see if the comments file has been loaded directly, and if it has an error message gets displayed. Next, it checks to see if the current post is password protected, and if it is then the user is asked to enter a password to see the page. Leave this bit of code alone; it’s important it is kept and, well, what has it ever done to you?</p><p>Next is the bit we’re interested in: the comments loop. It starts by checking if comments are open:</p><pre><code>&lt;?php if ( have_comments() ) : ?&gt;</code></pre><p>And if they are then some text is displayed, showing the number of comments a post has. Skip a couple of lines to line 28 where an ordered list is opened and inside that ordered list is &lt;?php wp_list_comments(); ?&gt;. This is another of WordPress’ template tags, and it spits out all of a post’s comments. There are other ways of displaying comments (that offer more customisation), but that is a post for another day; as I said, it’s quite a complicated subject.</p><p>Gloss over the next part (which is pretty self explanatory) to line 49. Here starts the form that you see on most blogs – this is the part where you fill out your name, email, website and comment. There isn’t really much need to customise this or change it in any way, so we won’t. Instead, we’ll go back to the single.php file and finish up with that.</p><h2>FINISHING OFF WITH THE SINGLE POSTS</h2><p>Open up the single.php file again and scroll down to line 37, just after where we left off. Here is something that again should look fairly familiar; it’s the loop finishing off and saying if no posts are found then display this:. The</p><pre><code>&lt;?php endif(); ?&gt;</code></pre><p>closes off the loop and then we get to the familiar looking get_sidebar and get_footer, which we learnt about in the previous installment of the series.</p><h2>CREATING A POST PAGE</h2><p>This tutorial has focused heavily on posts, without a mention of pages. The good news is that pages run identically to posts and so to create a post page, all you have to do is save another copy of your single.php file as page.php. And you’re done. I did say it was simple!</p><p><a
name="part-5"></a></p><h2>Creating an awesome archive</h2><p>According to the WordPress file hierarchy (which we discussed earlier), all archives – date, category, author and tag each have their own template file, but they also all fall back on a single file – the archive.php file. The idea here is that if you’re clever, you can save yourself creating a couple of additional files.</p><p>Upon opening the file, you’ll be greeted with the familiar get_header and the loop. Then, on line 14 starts a whole load of PHP if statements – if this is a category archive, display this, if this is a tag archive, display this etc etc. After that, on line 37 the loop swings into action and we have the familiar template tags we learnt in part two. Finally, on line 56 the standard “no posts were found” gets replaced with another if statement, changing it to “no posts were found under this category/tag etc etc”. After that, the familiar get_sidebar and get_footer and the archive page ends.</p><p>It’s pretty similar to the index.php page, all that is happening is that there are a couple of ifstatements to change the titles according to the archive.</p><h2>CREATING AN (EQUALLY AWESOME) HOMEPAGE</h2><p>Something you might have noticed is that so far we haven’t created a specific homepage. Whilst there is a homepage, that’s just the contents of the index.php file. At this point, it’d be appropriate to introduce a new template file: the home.php file. It’s highest in the hierarchy for the homepage, so WordPress first looks for the home.php file and if that doesn’t exist then it uses the index.php, which is why so far we’ve so far been creating a homepage with just the index.php.</p><p>Why can&#8217;t I just use the index?</p><p>Good question. You can’t because the index file is at the bottom of all template hierarchies – if you don’t have a specific template file for a certain type of page then WordPress displays the page using the index.php file. For that reason it is best to leave the index file as it is and create an additional page, home.php for generating a homepage. It’s also one of those useful little tricks that are good to know as it allows you to stop using WordPress as a blogging platform and start using it as a CMS.</p><p>In our example, we’re not going to do anything with our home.php file, other than make it and copy and paste the contents of the index.php file into it, but as someone who is getting started with WordPress theme development, it is something that you should know exists and you’ve always got the option of customising the homepage further yourself.</p><h2>THE FUNCTIONS.PHP FILE</h2><p>This is probably the most powerful template file there is. Effectively, it lets you run plugins from within your theme. It’s not a page that gets displayed, it’s a file that lets you run functions that you can display in other files. Common uses include:</p><ul><li>Widgets! Whilst you put where you want widgets to display in the theme files, but they’re powered from the functions.php file.</li><li>Theme options. Theme options pages are too created from the functions.php file. WPShout has a whole tutorial written on the topic <a
href="http://wpshout.com/create-an-advanced-options-page-in-wordpress/">here</a>.</li><li>Language – the functions.php file lets you set up the option for multi-lingual theming.</li></ul><p>As the functions file is just so complex, I’ll just cover some basics. The code below will create a widget area ‘Widget area 1’ with an opening div before (which closes after) and the widget title gets an H3 tag:</p><pre><code>&lt;?php if ( function_exists('register_sidebar') )

register_sidebar(array(

'name' =&gt; ' Widget area 1',

'before_widget' =&gt; '&lt;div&gt;',

'after_widget' =&gt; '&lt;/div&gt;',

'before_title' =&gt; '&lt;h3&gt;',

'after_title' =&gt; '&lt;/h3&gt;',

)); ?&gt;
</code></pre><p>To insert the widget in your sidebar you&#8217;ll need to add the following to your sidebar.php file (or wherever you want to widgetise):</p><pre><code>&lt;?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Widget area 1') ) : ?&gt;

&lt;p&gt;This area is widgetised! To make use of this area, put some widgets in the 'Widget area 1' section.&lt;/p&gt;

&lt;?php endif; ?&gt;</code></pre><p>This is just the start though; take a read of <a
href="http://wpshout.com/create-an-advanced-options-page-in-wordpress/">this</a>to find out how to build your own <a
href="http://wpshout.com/create-an-advanced-options-page-in-wordpress/">theme options page</a>.</p><h2>Concluding the series</h2><p>I hope this series has given you a good start with developing <a
href="http://wpshout.com/category/themes/">WordPress themes</a>, and make sure you <a
href="http://feeds2.feedburner.com/nometech">subscribe by RSS</a> to hone your skills further. As I hope I&#8217;ve proved in this post, it needn’t be hard to become aware of what all the bits of code on your theme do, and you never know, perhaps in a year or two I could be reading your blog about advanced uses of WordPress!</p> ]]></content:encoded> <wfw:commentRss>http://wpshout.com/wordpress-theme-design-basics/feed/</wfw:commentRss> <slash:comments>12</slash:comments> </item> <item><title>Effective Dropdown Menus With WordPress</title><link>http://wpshout.com/effective-dropdown-menus-with-wordpress/</link> <comments>http://wpshout.com/effective-dropdown-menus-with-wordpress/#comments</comments> <pubDate>Wed, 03 Feb 2010 12:00:51 +0000</pubDate> <dc:creator>Alex Denning</dc:creator> <category><![CDATA[Theme Design]]></category><guid
isPermaLink="false">http://wpshout.com/?p=2042</guid> <description><![CDATA[This article is taken from Packt&#8217;s &#8220;WordPress 2.8 Theme Design&#8221; with permission. A review of the book is coming soon. I don&#8217;t agree with everything that&#8217;s said, but I&#8217;ve decided to publish it as the overall jist of the post will be beneficial to many. This is the nice thing about WordPress it&#8217;s all &#8220;dynamic&#8221;.<a
href="http://wpshout.com/effective-dropdown-menus-with-wordpress/" class="read-more">Continue Reading</a>]]></description> <content:encoded><![CDATA[<p><em>This article is taken from Packt&#8217;s &#8220;<a
href="HTTP://WWW.PACKTPUB.COM/WORDPRESS-2-8-THEME-DESIGN-2ND-EDITION/BOOK">WordPress 2.8 Theme Design</a>&#8221; with permission. A review of the book is coming soon. I don&#8217;t agree with everything that&#8217;s said, but I&#8217;ve decided to publish it as the overall jist of the post will be beneficial to many.</em></p><p>This is the nice thing about WordPress it&#8217;s all &#8220;dynamic&#8221;. Once you install WordPress and design a great theme for it, anyone with the right level of administrative capability can log into the Administration Panel and add, edit, or delete content and menu items. But generally, when people ask for &#8220;dynamic menus&#8221;, what they really want are those appearing and disappearing drop-down menus which, I believe, they like because it quickly gives a site a very &#8220;busy&#8221; feel.</p><p>I must add my own disclaimer: I don&#8217;t like dropdowns. Before you get on to my case, I will say it&#8217;s not that they&#8217;re &#8220;wrong&#8221; or &#8220;bad&#8221;; they just don&#8217;t meet my own aesthetic standards and I personally find them <em>non-user friendly</em>. I&#8217;d prefer to see a menu system that, if subsections are required, displays them somewhere consistently on the page, either by having a vertical navigation expand to display subsections underneath, or showing additional subjections in a set location on the page if a horizontal menu is used.</p><p
style="text-align: center;"><img
src="http://www.packtpub.com/files/images/wordpress-theme-design-img01.png" alt="" /></p><p>I like to be able to look around and say, &#8220;OK, I&#8217;m in the <em>New Items</em><span
style="font-weight: bold;"> | </span><em>Cool Drink</em> section and I can also check out <em>Red Dinks</em><span
style="font-weight: bold;"> </span>and <em>Retro Dinks</em> within this section&#8221;. Having to constantly go back up to the menu and drop-down the options to remind myself of what&#8217;s available and what my next move might be, is annoying. Still haven&#8217;t convinced you not to use drop-downs? OK, read on.</p><h2>Drop-down menus</h2><p>So you&#8217;re going to use dropdowns. Again it&#8217;s not &#8220;wrong&#8221;; however, I would strongly caution you to help your client take a look at their target users before implementing them. If there&#8217;s a good chance that most users are going to use the latest browsers that support the current JavaScript, CSS, and Flash standards, and everyone has great mobility and is &#8220;mouse-ready&#8221;, then there&#8217;s really no problem in going for it.</p><p>If it becomes apparent that <em>any</em> percentage of the site&#8217;s target users will be using older browsers or have disabilities that prevent them from using a mouse and will limit them to tabbing through content, you must consider not using drop-down menus.</p><p>I was especially negative about drop-down menus as, until recently, they required bulky JavaScripting or the use of Flash, which does not make clean, semantic, and SEO-friendly (or accessible) XHTML. Enter the Suckerfish method developed by Patrick Griffiths and Dan Webb.</p><p>This method is wonderful because it takes valid, semantically accurate, unordered lists (WordPress&#8217; favorite!), and using almost pure CSS, creates dropdowns. The drop-down menus are not tab accessible, but they will simply display as a single, clear unordered list to older browsers that don&#8217;t support the required CSS.</p><p
style="margin-left: 40px; margin-right: 40px;"><em> IE6, as per usual, poses a problem or two for us, so there is some minimal DOM JavaScripting needed to compensate and achieve the correct effect in that browser.</em></p><p>If you haven&#8217;t heard of or worked with the Suckerfish method, I&#8217;m going to recommend you to go online (right now!) and read Dan and Patrick&#8217;s article in detail (<a
href="http://alistapart.com/articles/dropdowns" target="_blank">http://alistapart.com/articles/dropdowns</a>).</p><p>More recently, Patrick and Dan have revisited this method with &#8220;Son-of-a-Suckerfish&#8221;, which offers multiple levels and an even further pared down DOM JavaScript. Check it out at <a
href="%20http://www.htmldog.com/articles/suckerfish/dropdowns/" target="_blank">http://www.htmldog.com/articles/suckerfish/dropdowns/</a>.</p><p>I also suggest you play around with the sample code provided in these articles so that you understand exactly how it works. Go on, and read it. When you get back, I&#8217;ll review how to apply this method to your WordPress theme.</p><h2>DIY SuckerFish menus in WordPress</h2><p>All done? Great! As you can see, the essential part of this effect is getting your menu items to show up as unordered lists with sub unordered lists. Once you do that, the rest of the magic can be easily handled by finessing the CSS that Patrick and Dan suggest into your theme&#8217;s CSS and placing the DOM script in your theme&#8217;s header tag(s), in your <em>header.php</em> and/or <em>index.php</em> template files. Seriously, that&#8217;s it!</p><p>The really good news is that WordPress already outputs your content&#8217;s pages and their subpages using unordered lists. Right-click on the page links in Firefox to <strong>View Selected Source</strong> and check that the DOM inspector shows us that the menu is, in fact, being displayed using an unordered list.</p><p
style="text-align: center;"><img
src="http://www.packtpub.com/files/images/wordpress-theme-design-img02.png" alt="" /></p><p>Now you can go into your WordPress Administration panel and add as many pages and subpages as you&#8217;d like (<em>Administration</em><span
style="font-weight: bold;"> | </span><em>Page</em><span
style="font-weight: bold;"> | </span><em>Add New</em>). You&#8217;ll use the <em>Page Parent</em> tab on the right to assign your subpages to their parent.</p><p
style="text-align: center;"><img
src="http://www.packtpub.com/files/images/wordpress-theme-design-img03.png" alt="" /></p><p>If you installed the pageMash plugin, it&#8217;s even easier! You can drag-and-drop your created pages into any configuration you&#8217;d like. Just be sure to hit the <strong>Update</strong> button when you&#8217;re done.</p><p
style="text-align: center;"><img
src="http://www.packtpub.com/files/images/wordpress-theme-design-img04.png" alt="" /></p><p>Once you&#8217;ve added subpages to a page, you&#8217;ll be able to use the <span
style="font-weight: bold;">DOM Source of Selection</span> viewer to see that your menu is displayed with unordered lists and sublists.</p><p
style="text-align: center;"><img
src="http://www.packtpub.com/files/images/wordpress-theme-design-img05.png" alt="" /></p><p><span
style="color: #b0b0b0; font-family: Georgia; line-height: 24px; font-size: 20px; text-transform: uppercase;">Applying CSS to WordPress</span></p><p>We&#8217;re going to use the new and improved &#8220;Son-of-a-Suckerfish&#8221; method so that our menu can handle multilevel dropdowns. To start, let&#8217;s just take Dan and Patrick&#8217;s suggested code and see what happens. Their unordered list CSS looks like the following:</p><div
style="margin-left: 40px;"><pre>#nav, #nav ul { /* all lists */
padding: 0;
margin: 0;
list-style: none;
line-height: 1;
}
#nav a {
display: block;
width: 10em;
}
#nav li { /* all list items */
float: left;
width: 10em; /* width needed or else Opera goes nuts */
}
#nav li ul { /* second-level lists */
position: absolute;
background: orange;
width: 10em;
left: -999em; /* using left instead of display to hide menus
because display: none isn't read by screen
readers */
}
#nav li ul ul { /* third-and-above-level lists */
margin: -1em 0 0 10em;
}
#nav li:hover ul ul, #nav li:hover ul ul ul, #nav li.sfhover ul ul,
#nav li.sfhover ul ul ul {
left: -999em;
}
#nav li:hover ul, #nav li li:hover ul, #nav li li li:hover ul,
#nav li.sfhover ul, #nav li li.sfhover ul, #nav li li li.sfhover ul {
/* lists nested under hovered list items */
left: auto;
}</pre></div><p>Now in WordPress, our menu item&#8217;s <em>ul</em> is within a <em>div id</em> called <em>top_navlist</em>, and the <em>ul</em> ID is referred to as <em>navlist</em>. There may or may not be lots of other unordered lists used in our site, so we want to be sure that we <em>only</em> affect <em>uls</em> and <em>lis</em> within that <em>top_navlist</em> ID.</p><p>We&#8217;ll simply tweak the CSS a bit to move items to the left (unfortunately, this works best with horizontal <em>Navs</em> that are positioned from the left instead of the right) and make sure to add <em>#navlist</em> to each element in the Suckerfish CSS. Also, we already have a general <em>#top_navlist</em> and <em>#intTop_navlist</em> rule for the <em>div</em>, so we&#8217;ll want to make sure that this only affects the ul within that div by making sure it&#8217;s named <em>#navlist</em>. So, our navigation CSS styles now look something like the following:</p><div
style="margin-left: 40px;"><pre>/*////////// NAV //////////*/
#top_navlist {
position: absolute;
top: 260px;
width: 897px;
text-align:left;
}
#intTop_navlist {
position: absolute;
top: 173px;
width: 897px;
text-align:left;
}
#top_navlist h2, #intTop_navlist h2{
display: none;
}
#na vlist{
padding: 10px 10px;
margin-left: 0;
border-bottom: 1px solid #ccc;
font-family: Georgia, Times, serif;
font-weight: bold;
}
#navlist li{
list-style: none;
margin: 0;
display: inline;
}
#navlist li a{
padding: 11px 30px;
margin-left: 3px;
border: none;
border-left: 1px solid #ccc;
background: #8BA8BA url(images/oo_mag_main_nav.jpg) no-repeat top
right;
text-decoration: none;
color: #253A59;
}
#navlist li a:hover{
background-color: #9E9C76;
background-position: right -37px;
border-color: #C5BBA0;
color: #784B2C;
text-decoration: underline;
}
#navlist li.current_page_item a{
border-bottom: 1px solid white;
background-color: #fff;
background-position: right -74px;
}
#navlist li a:visited { color: #253A59; }
/*suckerfish menu starts here*/
#navlist li ul { /* second-level lists */
position: absolute;
border: none;
margin-top: 10px;
margin-left: 70px;
le ft: -999em; /* using left instead of display to hide menus
because display: none isn't read by screen
readers */
}
#navlist li ul li a {
display: block;
width: 150px;
font-family: Georgia, Century Schoolbook, Times, serif;
font-size: 12px;
text-transform:none;
font-variant: normal;
font-weight:bold;
border: 1px solid #666666;
background-color: #ffffff;
background-image: none;
}
#navlist li ul li a:hover {
background-color: #cccccc;
text-decoration: none;
}
#navlist li ul ul { /* third-and-above-level lists */
margin: -1em 0 0 7em;
}
#navlist li:hover ul ul, #nav li:hover ul ul ul, #nav li.sfhover ul
ul, #nav li.sfhover ul ul ul {
left: -999em;
}
#navlist li:hover ul, #nav li li:hover ul, #nav li li li:hover ul,
#nav li.sfhover ul, #nav li li.sfhover ul, #nav li li li.sfhover ul {
/* lists nested under hovered list items */
left: auto;
}</pre></div><h3>Applying the DOM script to WordPress</h3><p>The last bit is the JavaScript that ensures the hover works in IE6. I call it DOM scripting or the DOM script, but it&#8217;s basically just a JavaScript that rewrites your markup (how your DOM is being perceived by IE6) on-the-fly. This drop-down effect relies on the CSS hover attribute. IE6 only recognizes the hover attribute if it is applied to the a (link) entity. IE7 has fixed this limitation and it works similarly for Firefox and other browsers. Dan and Patrick&#8217;s script appends the additional <em>.sfhover</em> class to the <em>li</em> items in IE6 only.</p><p>You&#8217;ll need to add this script to your <em>index.php</em> and/or <em>header.php</em> template pages, inside the <em>header</em> tags. The thing to remember here is that Dan and Patrick named their <em>ul</em> tag&#8217;s ID as <em>nav</em> and that&#8217;s what this script is looking for. Our <em>ul</em> tag&#8217;s ID is named <em>top_navlist</em>, so by simply switching out <em>document. getElementById(&#8220;nav&#8221;);</em> to <em>document.getElementById(&#8220;navlist&#8221;);</em>, you&#8217;re good to roll in IE.</p><p>The full script in your header tags should look like the following (I prefer to tuck it into an <em>include</em> and place it in my <em>home.php</em> (or <em>index.php</em>) and <em>header.php</em> files with a JavaScript <em>include</em>.):</p><div
style="margin-left: 40px;"><pre>&lt;script type='text/javascript"&gt;&lt;!--//--&gt;&lt;![CDATA[//&gt;&lt;!--
sfHover = function() {
var sfEls = document.getElementById("navlist").getElementsByTagNam
e("LI");
for (var i=0; i&lt;sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=" sfhover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp("
sfhoverb"), "");
}
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
//--&gt;&lt;!]]&gt;&lt;/script&gt;</pre></div><p>For demonstration purposes, I&#8217;ve kept the CSS pretty bare boned and ugly; however, when we check this out in our browser, we now see the following:</p><p
style="text-align: center;"><img
src="http://www.packtpub.com/files/images/wordpress-theme-design-img06.png" alt="" /></p><p>It&#8217;s working ! Remember, with the preceding code, you can have drop-down menus that go three levels deep (Dan and Patrick&#8217;s <em>HTML Dog</em> article shows you how to make it handle as many levels as you&#8217;d like).</p><p
style="margin-left: 40px; margin-right: 40px;"><em><strong>Control those dropdown levels!<br
/> </strong>As cool as SuckerFish drop-downs are, refrain from going overboard on those levels! Cascading levels can become really tedious for a user to mouse through and can turn a site with a &#8220;busy feel&#8221; into a total mess. You&#8217;ll find that, with a little care, you can easily organize your site&#8217;s page content so that it only requires two levels. From there, if you <em>really need it</em>, you can add an occasional third level without creating too much user distraction.</em></p><h3>Allowing only selected pages to display</h3><p>In our theme, we used the <em>wp_list_pages()</em> template tag to display our pages. You can amend the template tag with an exclude parameter that will hide the pages we don&#8217;t want to see, including their subpages (for example, <em>wp_list_pages(&#8220;exclude=9&amp;title_li=&#8221; ); </em>). You do have to know what the page&#8217;s ID number is. (You can temporarily set your permalinks to &#8220;default&#8221; to see the page&#8217;s ID number in the site&#8217;s URL.) The pages themselves will still be available for viewing if you know their direct URL path. Read more about it at <a
href="%20http://codex.wordpress.org/Template_Tags/wp_list_pages#Exclude_Pages_from_List%20" target="_blank">http://codex.wordpress.org/Template_Tags/wp_list_pages#Exclude_Pages_from_List</a>.</p><h3>Hiding pages the easy way with pageMash</h3><p>If you have intalled the pageMash plugin by Joel Starnes <a
href="%20http://wordpress.org/extend/plugins/pagemash/%20" target="_blank">http://wordpress.org/extend/plugins/pagemash/</a>, displaying and hiding pages is super easy! Simply select hide from the option next to your page. The page will still be available via its permalink URL, but will not display in your drop-down menu.</p><p
style="text-align: center;"><img
src="http://www.packtpub.com/files/images/wordpress-theme-design-img07.png" alt="" /></p><p>At this point , all that&#8217;s left is fixing up the CSS to make it look exactly the way you want. There you go, semantic, SEO, and as accessible-as-possible dynamic menus in WordPress.</p><p
style="margin-left: 40px; margin-right: 40px;"><em><strong>Drop-down menu plugins</strong>: Now you&#8217;re probably already thinking, &#8220;Wait, this is WordPress; maybe there&#8217;s a plugin&#8221; and you&#8217;d be right! By searching the &#8220;Extend&#8221; section of the <em>WordPress.org</em> site, you&#8217;ll find that there are a handful of WordPress plugins that allow for drop-down menus under different conditions. Ryan Hellyer has written a plugin that uses the &#8220;Son-of-a-SuckerFish&#8221; method that we reviewed in detail earlier. You can review it at <a
href="%20http://wordpress.org/extend/plugins/ryans-suckerfish-wordpress-dropdown-menu/" target="_blank">http://wordpress.org/extend/plugins/ryans-suckerfish-wordpress-dropdown-menu/</a>.</em></p> ]]></content:encoded> <wfw:commentRss>http://wpshout.com/effective-dropdown-menus-with-wordpress/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> <item><title>Best Practices for Creating Unique Blog Posts</title><link>http://wpshout.com/best-practices-for-creating-unique-blog-posts/</link> <comments>http://wpshout.com/best-practices-for-creating-unique-blog-posts/#comments</comments> <pubDate>Wed, 27 Jan 2010 17:34:57 +0000</pubDate> <dc:creator>Alex Denning</dc:creator> <category><![CDATA[Art Direction]]></category> <category><![CDATA[Unique Post Design]]></category><guid
isPermaLink="false">http://wpshout.com/?p=1643</guid> <description><![CDATA[Recently here on WPShout I've been sharing little tips that will help create a unique look for individual blog posts. Today we'll be rounding up the "best practices" for creating that unique look, the easy way.]]></description> <content:encoded><![CDATA[<p>Recently here on <a
href="http://wpshout.com">WPShout</a> I&#8217;ve been sharing little tips that will help create a unique look for individual blog posts. Today we&#8217;ll be rounding up the &#8220;best practices&#8221; for creating that unique look, <em>the easy way</em>.</p><h2>Post templates</h2><p>Getting rid of the sidebar is a simple way to expand your options. Were we using pages, it would be easy to get rid of the sidebar with a page template, but those don&#8217;t exist for posts, do they? Wrong. They do. You just need <a
href="http://www.nathanrice.net/plugins/single-post-template/">a plugin</a> which gives you page-like options for choosing your post template:</p><pre><code>&lt;?php
/*
Single Post Template: Template Name
Description: This part is optional, but helpful for describing the Post Template
*/
?&gt;</code></pre><p>And then with some simple styling you can widen your content area and get rid of the sidebar, offering you more room to create an awesome post.</p><h2>Multiple sidebars</h2><p>Say you don&#8217;t want to get rid of the sidebar, but instead display a <em>different</em> sidebar. That&#8217;s easy if you do multiple sidebars <em><a
href="http://wpshout.com/multiple-sidebars-the-right-way-in-wordpress/">the right way</a>, </em>which, of course, has the following syntax:</p><ul><li>Save new sidebars with the sidebar-<em>name</em>.php format.</li><li>Use <code>&lt;?php get_sidebar(); ?&gt;</code> to display new sidebars:<code> &lt;?php get_sidebar('name'); ?&gt;</code></li></ul><p>You can then create a page template with your different combinations of sidebar and make that blog post just <em>that bit more</em> unique.</p><h2>Unique titles</h2><p>Image replacement, emphasis, bold, the lot are all possible thanks to custom fields. Expanding further on <a
href="http://wpshout.com/awesome-wordpress-seo-with-custom-fields/">this post</a>, unique titles <em>with image replacement</em> are really easy to do. You just need to create a custom field called &#8220;post-title&#8221; and then you can put into that any kind of HTML you like &#8211; perhaps an image or just some emphasis? It&#8217;s all easy to do; you&#8217;ll need to replace &lt;?php the_title(); ?&gt; with the following code which will search for a custom field, display it if it exists and then fall back on the title.</p><pre><code>&lt;?php
$postitle = get_post_custom_values("post-title");
if ( is_array($postitle) ) { ?&gt;
&lt;?php echo get_post_meta($post-&gt;ID, "post-title", true); ?&gt;
&lt;?php }	else { ?&gt;
&lt;?php the_title(); ?&gt;
&lt;?php } ?&gt;</code></pre><p>Remember that custom fields can hold <em>any</em> kind of information and so you can put whatever you like in them to be displayed as the title &#8211; an image, some emphasis or just some text; do <em>whatever you like</em>.</p><h2>Inline styling</h2><p>Custom fields to the rescue again; we can use custom fields to add some simple styling to any post. As we&#8217;re outside of the loop, we&#8217;ll need some extra code, but nothing too complicated:</p><p>&lt;?php $css = get_post_meta($post-&gt;ID, &#8216;css&#8217;, true); ?&gt;</p><p>Needs to go at the top of your header file and then below your stylesheet, you&#8217;ll need the following:</p><pre><code>&lt;?php echo $css; ?&gt;
</code></pre><p>And then you can fill in your custom field with some inline styling and perhaps change the background:</p><pre><code>&lt;style type="text/css" media="screen"&gt;

body{ background: #fff; }

&lt;/style&gt;<span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: small;"><span style="line-height: 19px; white-space: normal;">
</span></span></code></pre><h2>Create columns of text <em>within the post</em></h2><p>This is probably my favourite. Using a simple grid system, it&#8217;s possible to put your content into many columns. <a
href="http://wpshout.com/the-death-of-the-boring-blog-post-easily-add-columns-to-any-wordpress-post/">This post</a> explains all. You may ask why you don&#8217;t just use a &lt;p class=&#8221;grid1&#8243;&gt;-like system. The answer is that WordPress automatically adds in the &lt;p&gt; tag, so the only real option is to use &lt;div&gt;s.</p><h2>Concluding</h2><p>So there we have a number of ways to create a really fantastic unique blog post. Go and reap the rewards!</p> ]]></content:encoded> <wfw:commentRss>http://wpshout.com/best-practices-for-creating-unique-blog-posts/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>10 More Tips To Improve Your WordPress Theme</title><link>http://wpshout.com/10-more-tips-to-improve-your-wordpress-theme/</link> <comments>http://wpshout.com/10-more-tips-to-improve-your-wordpress-theme/#comments</comments> <pubDate>Mon, 30 Nov 2009 12:00:15 +0000</pubDate> <dc:creator>Alex Denning</dc:creator> <category><![CDATA[Featured]]></category> <category><![CDATA[Theme Design]]></category><guid
isPermaLink="false">http://wpshout.com/?p=1486</guid> <description><![CDATA[10 More Ways to Improve Your WordPress Theme in this post - add a theme options page, multiple sidebars, custom write fields and awesome SEO!]]></description> <content:encoded><![CDATA[<p>Consistently one of the most popular posts on <a
href="http://wpshout.com">WPShout</a> is &#8220;10 Tips to Improve Your WordPress Theme&#8221;, so here are ten more! In this post we&#8217;ll look ways to cleverly improve your <a
href="http://wpshout.com/category/themes/">theme</a> not just from the front end but also in the backend with some rather lovely advanced features. <em>And in light of the feedback, list posts will remain. Just slightly better this time.</em></p><h2>1. Use a framework</h2><p><img
class="alignnone" src="http://nometech.com/wpshout.com/wp-content/uploads/images/rlekfu.png" alt="" width="559" height="173" /></p><p>Initially, like a lot of people, I wasn&#8217;t convinced with frameworks. Now I&#8217;m totally won over. <strong>Frameworks offer you that crucial starting point</strong> for <a
href="http://wpshout.com/category/themes/">WordPress themes</a> and save you coding the same things over and over again. And again. And again. These days the choice is massive &#8211; from highly complex frameworks with their own hooks such as <a
href="http://themeshaper.com">Thematic</a>, <a
href="http://themehybrid.com">Hybrid </a>and <a
href="http://prodigytheme.com">Prodigy </a>to the more simplistic <a
href="http://wpshout.com/free-wordpress-magazineframeworkbloggytech-blog-theme-biblioteca/">Biblioteca</a>. Download a couple, find one you like, customise it to your needs. You&#8217;ll have doubled your coding time with just a couple of hours&#8217; work.</p><h2>2. Awesome SEO</h2><p>These days bloggers care more and more about having &#8220;awesome SEO&#8221;. Understandably too. Theme authors are picking up on this too and increasingly themes are being released marketed with said &#8220;awesome SEO&#8221;. Thanks to the GPL, many of these themes are actually using the same code! <a
href="http://wpshout.com/improve-wordpress-blogs-seo-in-10-easy-ways/">As I wrote a couple of weeks ago</a>, <strong>write great content</strong>, use your Header tags correctly and use the <code>&lt;title&gt;</code> tag effectively and you&#8217;ll be fine &#8211; for more SEO tips, check out &#8220;<a
href="http://wpshout.com/improve-wordpress-blogs-seo-in-10-easy-ways/">10 Ways to Improve Your WordPress Theme&#8217;s SEO</a>&#8220;.</p><h2>3. Use an <em>advanced</em> theme options page</h2><p><img
class="alignnone size-full wp-image-1301" title="options-featured" src="http://wpshout.com/wp-content/uploads/2009/10/options-featured.jpg" alt="options-featured" width="590" height="320" /></p><p>Again thanks to the GPL, theme options pages, once found only in a select few themes, are now found pretty much everywhere. Creating your own options page isn&#8217;t that hard (and needn&#8217;t be hard either) &#8211; recently <a
href="http://wpshout.com">WPShout</a> ran &#8220;<strong><a
href="http://wpshout.com/create-an-advanced-options-page-in-wordpress/">Create an Advanced Theme Options Page</a></strong>&#8221; in which, as you might have guessed, we created an advanced theme options page with options such as changing the stylesheet and various other areas of the theme.</p><h2>4. Don&#8217;t use custom fields unneccesarily</h2><p>Whilst I do love <strong><a
href="http://wpshout.com/10-awesome-things-to-do-with-wordpress-custom-fields/">custom fields</a></strong>, I don&#8217;t love using them unneccesarily. If you&#8217;re making a magazine theme such as the one used on WPShout, you needn&#8217;t use custom fields to display images on the homepage or the like (and all this won&#8217;t be needed at all with WordPress 2.9 &#8211; read more about it <a
href="http://wpengineer.com/new-feature-in-wordpress-2-9-the_post_image/">here</a>). As <a
href="http://webdeveloperplus.com/wordpress/how-to-use-thumbnails-generated-by-wordpress-in-your-theme/">WebDeveloperPlus points out</a>, <strong>WordPress creates its own thumbnails</strong> that can be relatively easily used by any theme using the <code>wp_get_attachment_thumb_url</code> function (<a
href="http://codex.wordpress.org/Function_Reference/wp_get_attachment_thumb_url">codex</a>).</p><h2>5. Custom write fields!</h2><p><img
class="alignnone size-full wp-image-1039" title="postoptions" src="http://wpshout.com/wp-content/uploads/2009/08/postoptions.jpg" alt="postoptions" width="590" height="320" /></p><p>I do love these. Custom write fields. They&#8217;re essentially adding little boxes onto the bottom of the post writing area in WordPress. And they&#8217;re brilliant. On WPShout I&#8217;m running a child theme of <a
href="http://wpshout.com/free-wordpress-magazineframeworkbloggytech-blog-theme-biblioteca/">Biblioteca</a> and so have a box &#8220;Post options&#8221; that lets me change the post&#8217;s &lt;title&gt;, meta description and set one of two featured images. Adding these custom write fields to a theme is relatively easy with this tutorial I wrote a while ago. With them up and running, you can now offer a number of options and <strong>replace plugins</strong> such as the &#8220;All in one SEO plugin&#8221;. Awesome, no?!</p><h2>6. Use the template hierarchy cleverly</h2><p>WordPress&#8217; <a
href="http://wpshout.com/wordpress-template-file-hierarchy-explained/">template hierarchy</a> is a great thing and you can create something really awesome by using it correctly. Here&#8217;s a case study. You&#8217;re using <a
href="http://wpshout.com/wordpress-as-a-cms/"target="_blank"title="WordPress As A CMS" >WordPress as a CMS</a> for a portfolio site. You want to use category archives to display the latest blog posts <em>and</em> your portfolio which has a <strong>d</strong><strong>ifferent design completely</strong>. You would first need to create two categories, &#8220;Portfolio&#8221; and &#8220;Blog&#8221; and find their IDs (although 2.9 onwards you can just use the slug of the category). Let&#8217;s pretend &#8220;Portfolio&#8221; has an ID of 3 and &#8220;Blog&#8221; 4. Next, style your pages and then save the two files not as category.php (as you would for a category archive normally) but as category-3.php and category-4.php. You&#8217;ve now just created two category archives that will output posts completely differently! Awesome, no?</p><h2>7. Custom widgets</h2><p>Custom widgets are the next big thing. That&#8217;s for sure. Get ahead of the game by including custom widgets in their theme and <a
href="http://feeds2.feedburner.com/nometech">subscribe by RSS</a> to <a
href="http://wpshout.com">WPShout</a> as soon I&#8217;ll be writing a tutorial on how to create your own awesome widget.</p><p><span
class="link">Download the latest <a
href="http://www.testkingsite.com/cisco/CCNA.html">ccna dumps</a> with complete <a
href="http://www.testkingsite.com/cisco/642-661.html">642-661</a> notes prepared to help you pass <a
href="http://www.testkingsite.com/cisco/642-631.html">642-631</a> on first try.</span></p><h2>8. Use sticky posts efficiently and effectively</h2><p><img
class="alignnone size-full wp-image-1499" title="sticky-post" src="http://wpshout.com/wp-content/uploads/2009/11/sticky-post.jpg" alt="sticky-post" width="590" height="300" /></p><p>Used effectively and effectively, you can do a lot of awesome stuff with sticky posts. A number of examples. First, say we just want to <strong>highlight sticky posts</strong>. With WordPress 2.7&#8242;s <code>post_class</code> you can do this by adding some styling for <code>.sticky</code> . The full code would be something like:</p><pre><code>&lt;?php if(have_posts()) : while(have_posts()) : the_post(); ?&gt;
&lt;div &lt;?php post_class(); ?&gt;&gt;
&lt;h2&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;?php the_excerpt(); ?&gt;
&lt;/div&gt;
&lt;?php endwhile; ?&gt;
&lt;?php endif; ?&gt;</code></pre><p>And with CSS styling:</p><pre><code>.sticky{
     background:yellow;
}</code></pre><p>As you can see, pretty simple (inspiration for this from <a
href="http://wordpress.org/extend/themes/shades-of-blue">Shades of Blue</a>). Taking this further though, you could single out sticky posts and <strong>use them instead of that blasted &#8220;Featured&#8221; category</strong>! <a
href="http://www.darrenhoyt.com/2007/08/05/wordpress-magazine-theme-released/">Mimbo </a>does this particularly well, outputting first a single sticky post and then a seperate loop with the next X posts, excluding the first:</p><pre><code> &lt;?php
	$postCount = 0;
	$page = (get_query_var('paged')) ? get_query_var('paged') : 1;
	query_posts( 'paged=$page&amp;post_per_page=-1&amp;cat=' . get_query_var('cat') );
	while (have_posts()) { the_post();
		if( $postcount == 0 ) {
		//GETS LATEST OR STICKY POST
	?&gt;

&lt;!-- do stuff --&gt;    

		&lt;?php
		}
		elseif( $postcount &gt; 0 &amp;&amp; $postcount &lt;= 4 ) {
		//GETS NEXT FOUR EXCERPTS
		?&gt;

&lt;!-- do more stuff --&gt;

&lt;?php endif; endwhile; ?&gt;</code></pre><h2>9. Multiple sidebars and layouts</h2><p>An increasing trend this that is done especially well on <a
href="http://binarymoon.co.uk">BinaryMoon.co.uk</a> &#8211; having two sidebars &#8211; one that gets displayed on the homepage and another that gets displayed in posts:</p><p><img
class="size-full wp-image-1496 alignnone" title="changing-sidebars" src="http://wpshout.com/wp-content/uploads/2009/10/changing-sidebars.jpg" alt="changing-sidebars" width="590" height="300" /></p><p>An effect such as this is quite easy to do with the right<a
href="http://wpshout.com/wordpress-template-file-hierarchy-explained/"> template hierarchy</a>. First, create two sidebars and save them as sidebar.php and sidebar-single.php. Next, open up the functions.php file and add the following:</p><pre><code>&lt;?php if ( function_exists ('register_sidebar')) {
    register_sidebar ('single');
} ?&gt;</code></pre><p>Next, open up the single.php file and change  to . And you&#8217;re done. This is assuming that you want to keep the homepage sidebar on archives. If not, do it the other way round (ie sidebar-home.php). Read more on this at <a
href="http://codex.wordpress.org/Customizing_Your_Sidebar#New_way_of_adding_sidebars">the codex</a>.</p><h2>10. Custom YARRP templates</h2><p><img
class="alignnone" src="http://nometech.com/wpshout.com/wp-content/uploads/images/flav3a.png" alt="" width="600" height="172" /></p><p>I do love this tip from <a
href="http://epicalex.com">Alex Cragg</a> &#8211; <strong>custom templates for the </strong><a
href="http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/"><strong>Yet Another Related Posts Plugin</strong></a>. Using jQuery, Alex created a YARRP template that changes the image as you hover over different posts. Check out the demo <a
href="http://epicalex.com/yarppdemos.php">here </a>and download the templates <a
href="http://epicalex.com/yarpp-templates/">here</a>.</p><p>And with that, we&#8217;re done. Hopefully you&#8217;ve now got yourself an <em>awesome</em> WordPress theme! If you&#8217;ve enjoyed this post, why not [f] or <a
href="http://feeds2.feedburner.com/nometech">subscribe by RSS</a>?</p> ]]></content:encoded> <wfw:commentRss>http://wpshout.com/10-more-tips-to-improve-your-wordpress-theme/feed/</wfw:commentRss> <slash:comments>13</slash:comments> </item> <item><title>The Death of the Boring Blog Post &#8211; Easily Add Columns to Any WordPress Post</title><link>http://wpshout.com/the-death-of-the-boring-blog-post-easily-add-columns-to-any-wordpress-post/</link> <comments>http://wpshout.com/the-death-of-the-boring-blog-post-easily-add-columns-to-any-wordpress-post/#comments</comments> <pubDate>Thu, 26 Nov 2009 12:00:35 +0000</pubDate> <dc:creator>Alex Denning</dc:creator> <category><![CDATA[Art Direction]]></category><guid
isPermaLink="false">http://wpshout.com/?p=1634</guid> <description><![CDATA[Easily put your post's content into columns using just the WordPress text editor and a CSS grid.]]></description> <content:encoded><![CDATA[<p>Smashing Magazine recently published a wonderful post &#8220;The Death of the Boring Blog Post&#8221; which touches more or less on what I shared the other day &#8211; multiple post templates. Today we&#8217;re going to expand on that tutorial (except this is the really easy way).<br
/> It was watching <a
href="http://net.tutsplus.com/videos/screencasts/5-more-helpful-video-quick-tips/">a screencast on Nettuts</a> the other day that inspired this post. Jeffrey Way was showing how to change the background of a post with custom fields (which is yet another example of the brilliance of the things!) when he shows a demo on his personal test area. The test area is a framework called &#8220;Flexible-WP&#8221;. I have no idea what it&#8217;s designed to do, but looking at <a
href="http://tests.jeffrey-way.com/flexible-wp/?p=1">a post</a>, this is a pretty neat idea. Set some styling and use divs <em>within posts</em> to put posts into columns.<br
/> Here&#8217;s an example. Jeffrey has <a
href="http://tests.jeffrey-way.com/flexible-wp/wp-content/themes/flexible-wp/style.css">a grid</a>. This grid can then be applied within posts just by going into the HTML editor in WordPress and adding a div around some text:-</p><pre><code>
<div class="g4">A paragraph of interesting text.</div>
<div class="g4">A paragraph of more interesting text.</div>

</code></pre><p>And then you&#8217;d have two bits of text which would be in columns next to each other. Clever, no?</p><p><img
class="alignnone" src="/wp-content/uploads/images/ysswtt.png" alt="" width="482" height="495" /></p><h2>Implementation</h2><p>Implementation of this is actually quite simple. You&#8217;ll need a grid. If you&#8217;re using a theme based on a framework, it&#8217;s quite probably got the 960 grid system built in, in which case you can use that. If not, open up your style.css file and either create your own or use something similar to the below which Jeffrey uses on his site:</p><pre><code>.g1 { width: 60px; margin-left: 10px; margin-right: 10px; float: left; display: inline; }
.g2 { width: 140px; margin-left: 10px; margin-right: 10px; float: left; display: inline; }
.g3 { width: 220px; margin-left: 10px; margin-right: 10px; float: left; display: inline;}
.g4 { width: 300px; margin-left: 10px; margin-right: 10px; float: left; display: inline; }
.g5 { width: 380px; margin-left: 10px; margin-right: 10px; float: left; display: inline; }
.g6 { width: 460px; margin-left: 10px; margin-right: 10px; margin-bottom: 20px; float: left; display: inline; }
.g7 { width: 540px; margin-left: 10px; margin-right: 10px; float: left; display: inline; }
.g8 { width: 620px; margin-left: 10px; margin-right: 10px; float: left; display: inline; }
.g9 { width: 700px; margin-left: 10px; margin-right: 10px; margin-bottom: 20px; float: left; display: inline; }
.g10 { width: 780px; margin-left: 10px; margin-right: 10px; float: left; display: inline; }
.g11 { width: 860px; margin-left: 10px; margin-right: 10px; float: left; display: inline; }
.g12 { width: 940px; margin-left: 10px; margin-right: 10px; float: left; display: inline; }</code></pre><p>And then when writing, you can utilise your grid by wrapping text as I show above. A really easy (and effective) to make your blog post <em>that </em>bit more unique and exciting.</p> ]]></content:encoded> <wfw:commentRss>http://wpshout.com/the-death-of-the-boring-blog-post-easily-add-columns-to-any-wordpress-post/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (user agent is rejected)
Database Caching 16/30 queries in 0.045 seconds using disk
Content Delivery Network via wpshout.wpcdn.com (user agent is rejected)

Served from: wpshout.com @ 2010-09-02 14:36:56 -->