<?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>Think2Loud &#187; WordPress</title> <atom:link href="http://think2loud.com/cat/wordpress/feed/" rel="self" type="application/rss+xml" /><link>http://think2loud.com</link> <description>Random thoughts from a few geeks</description> <lastBuildDate>Wed, 04 Jan 2012 01:43:02 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" /> <item><title>Tranformers of Themes</title><link>http://think2loud.com/1145-tranformers-of-themes/</link> <comments>http://think2loud.com/1145-tranformers-of-themes/#comments</comments> <pubDate>Wed, 04 Jan 2012 01:43:02 +0000</pubDate> <dc:creator>doug</dc:creator> <category><![CDATA[Themes]]></category> <category><![CDATA[WordPress]]></category><guid isPermaLink="false">http://think2loud.com/?p=1145</guid> <description><![CDATA[<p>It just so happens that here at Think2Loud we love WordPress. We&#8217;re hoping that some of you do too and we want to share some of the exciting things we&#8217;ve learned or used that WordPress users (both novice and advanced) &#8230; <a href="http://think2loud.com/1145-tranformers-of-themes/">Read More</a></p><p><a href="http://think2loud.com/1145-tranformers-of-themes/">Tranformers of Themes</a></p>]]></description> <content:encoded><![CDATA[<p style="text-align: left;">It just so happens that here at Think2Loud we love WordPress. We&#8217;re hoping that some of you do too and we want to share some of the exciting things we&#8217;ve learned or used that WordPress users (both novice and advanced) will find useful and informative. But we&#8217;re sure we don&#8217;t have all the answers, so if you think we&#8217;ve missed something please let us know in the comments. We&#8217;ll do our best to respond quickly!</p><p style="text-align: center;"><img class="size-medium wp-image-1146 aligncenter" title="think2loud-optimus-prime" src="http://zippy.think2loud.com/wp-content/uploads/2011/10/think2loud-optimus-prime-234x300.jpg" alt="" width="234" height="300" /></p><p style="text-align: left;">You may have noticed that we changed our theme not too long back. We are running the Together theme by ThemeBrewers.com and now that we&#8217;ve had time to play around with it here and on our other sites we wanted to start sharing some of the things we really like about it starting with its ability to transform itself into lots of different looks with just a few clicks&#8230;</p><h3 style="text-align: left;">Global Theme Layout</h3><p>The ability to set a global layout was one of the first things that really sold us on using the ThemeBrewer themes. Anyone who has purchased a theme somewhere only to find out that it would take an act of God or the very least help from one of your nerdy&#8230;errr&#8230;technically gifted&#8230;friends to get it to do what you wanted it to do should appreciate the incredible simplicity of radio buttons to change their layout. And better yet, you can wait to call in that favor from your own personal tech support until you really need it.</p><p>&nbsp;</p><p style="text-align: center;"><a href="http://zippy.think2loud.com/wp-content/uploads/2012/01/think2loud-global-layout.png" rel="lightbox"><img class="aligncenter size-large wp-image-1239" title="think2loud-global-layout" src="http://zippy.think2loud.com/wp-content/uploads/2012/01/think2loud-global-layout-1024x650.png" alt="" width="500" height="317" /></a></p><h3>Per Page Layout</h3><p>But what happens when you have some content that just can&#8217;t follow your global layout? Perhaps you have some graphics or other content that just doesn&#8217;t fit with the sidebar or maybe you need an extra sidebar for a particular page. That&#8217;s no problem either because each page can specify its own layout independent of the global option. Pretty cool stuff! And of course what makes us happiest about this whole process is we didn&#8217;t have to dig around in the theme code to make these changes.  And hey, it&#8217;s not like we&#8217;re lazy or we couldn&#8217;t write some code if we had to, but our TiVo might fill up and not record something important!  There are just some risks not worth taking.</p><p style="text-align: center;"><a href="http://zippy.think2loud.com/wp-content/uploads/2011/10/think2loud-page-layout.png" rel="lightbox"><img class="aligncenter size-medium wp-image-1151" title="think2loud-page-layout" src="http://zippy.think2loud.com/wp-content/uploads/2011/10/think2loud-page-layout-300x172.png" alt="" width="300" height="172" /></a></p><p style="text-align: left;">We hope to delve into more of the cool features we like about ThemeBrewers themes over the next few weeks and we may even start tinkering with some of their other themes just to help us get familiar with, and test out, all the features. Besides, it&#8217;s always fun to redesign your blog, right?  Especially if it can be done quickly.</p><p style="text-align: left;">Let us know what you think in the comments and maybe even consider signing up for our newsletter.  We will be testing out a new WordPress newsletter application in the next few months, but we promise not to spam you. Optimus Prime would never allow it!</p><p><a href="http://think2loud.com/1145-tranformers-of-themes/">Tranformers of Themes</a></p>]]></content:encoded> <wfw:commentRss>http://think2loud.com/1145-tranformers-of-themes/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Espresso Theme Framework and ThemeBrewers</title><link>http://think2loud.com/947-espresso-theme-framework-and-themebrewers/</link> <comments>http://think2loud.com/947-espresso-theme-framework-and-themebrewers/#comments</comments> <pubDate>Tue, 19 Jul 2011 13:27:57 +0000</pubDate> <dc:creator>superadmin</dc:creator> <category><![CDATA[WordPress]]></category><guid isPermaLink="false">http://think2loud.com/?p=947</guid> <description><![CDATA[<p>Introducing ThemeBrewers and easy-to-use Espresso Framework that launched yesterday. ThemeBrewers is a new place to get premium and free WordPress themes all built on their new theme framework Espresso. <a href="http://think2loud.com/947-espresso-theme-framework-and-themebrewers/">Read More</a></p><p><a href="http://think2loud.com/947-espresso-theme-framework-and-themebrewers/">Espresso Theme Framework and ThemeBrewers</a></p>]]></description> <content:encoded><![CDATA[<p>Introducing <a target="_blank" href="http://themebrewers.com/">ThemeBrewers</a> and the <a target="_blank" href="http://themebrewers.com/theme/espresso/">easy-to-use Espresso Framework</a> that launched yesterday. ThemeBrewers is a new place to get premium and free WordPress themes all built on their new theme framework Espresso. Custom built easy to use option are the foundation of the Espresso framework. Espresso is a parent theme and uses template parts to allow for easy customization of your child theme.</p><h4>Espresso Features</h4><ul class="feature-split clearfix"><li>Multiple Layout Options for Header, Content and Footer Areas</li><li>Easy-to-Use UI for Theme Customizations</li><li>Unlimited Sites</li><li>Unlimited Updates via Automated Updates</li><li>Optimized for WordPress 3.1+</li><li>SEO Optimized and Developed to Work with <a target="_blank" href="http://yoast.com/wordpress/seo/" target="_blank">WordPress SEO Plugin</a> by Yoast</li><li>Custom Image Sizes with Image Regeneration Support</li><li>Custom CSS and Styling Options</li><li>7 Widgetized Areas (one in the header, two in the sidebar, four in the footer)</li><li>Multiple Shortcodes and more</li></ul><h4>Win a free Pro Membership</h4><p>With the grand opening of Themebrewers they are giving away a free pro membership. All you have to do is go to the following link and enter to win.<br /> <a target="_blank" href="http://themebrewers.com/108-themebrewers-wordpress-themes/">ThemeBrewers Give Away</a></p><p><a href="http://think2loud.com/947-espresso-theme-framework-and-themebrewers/">Espresso Theme Framework and ThemeBrewers</a></p>]]></content:encoded> <wfw:commentRss>http://think2loud.com/947-espresso-theme-framework-and-themebrewers/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Organize your WordPress Theme in 3 Easy Steps</title><link>http://think2loud.com/912-organize-your-wordpress-theme-in-3-easy-steps/</link> <comments>http://think2loud.com/912-organize-your-wordpress-theme-in-3-easy-steps/#comments</comments> <pubDate>Thu, 17 Mar 2011 00:17:46 +0000</pubDate> <dc:creator>Jared</dc:creator> <category><![CDATA[Code 101]]></category> <category><![CDATA[WordPress]]></category><guid isPermaLink="false">http://think2loud.com/?p=912</guid> <description><![CDATA[<p>Like many developers out there, I do my best to write clean and manageable code.  Read on to find out three simple steps to make your WordPress themes better than ever. <a href="http://think2loud.com/912-organize-your-wordpress-theme-in-3-easy-steps/">Read More</a></p><p><a href="http://think2loud.com/912-organize-your-wordpress-theme-in-3-easy-steps/">Organize your WordPress Theme in 3 Easy Steps</a></p>]]></description> <content:encoded><![CDATA[<p>I make an effort to keep my code clean for two reasons, ease of use and maintainability. It&#8217;s far easier to fix bugs or make updates to the code if it&#8217;s clean.  It will take much more time if six months or a year from now you need to re-examine your code to figure it out, rather than just fixing the issue.  I also am a firm believer in the saying &#8220;if you&#8217;re going to do it, do it right the first time.&#8221; and by proxy &#8220;make it right&#8221;.  Every developer sees some &#8220;bad code&#8221; at some point, sometimes they may have even written it.  I feel it&#8217;s important to correct wrongs as you see them and improve your own code as you go.</p><p>That&#8217;s no easy task, but WordPress makes it a little easier when it comes to theme development.  Here&#8217;s three steps you can take to make your themes a little better than before.</p><p><strong>Step One</strong>: Proper Template Directories</p><p>This is more of a general step you can take, but still useful, and it&#8217;s as simple as creating folders to organize your files in. Many developers like to have seperate folders for JavaScript, CSS, and images. These are the folders that I use to keep everything in its place:</p><ul><li>/theme-directory/css/</li><li>/theme-directory/images/</li><li>/theme-directory/js/</li><li>/theme-directory/includes/</li></ul><p>That last one is important.  Anything custom that i&#8217;m building for the theme, such as a meta box or option page for the admin section of WordPress, would live in this folder.  I used to put some front end PHP in there as well, but more on that later.</p><p><strong>Step 2</strong>: Registering your CSS and JavaScript</p><p>WordPress comes with several functions you can use to queue and load your CSS and JavaScript files.  You can set a version number for the files, and even tell WordPress that a specific file requires a previously queued file before this one loads (for example, requiring that jQuery is loaded before a jQuery plugin your theme needs gets loaded).</p><p><strong>Step 3</strong>: Use WordPress Template Files!</p><p>WordPress is built around themes and plugins, and it&#8217;s really easy to make your theme easy to manage if you use what has been given to you.  The best example of this is the function get_template_part().  This function allows for you to split your template files into smaller more manageable blocks of code.  For example, you can make a loop.php file that you can use in all of your template files and include it simply by calling get_template_part(&#8220;loop&#8221;).  It&#8217;s just that easy!  You can use this function to display any file you make in the main template directory, the possibilities are endless.</p><p>That&#8217;s all there is to it.  Check out the following links for more information.</p><p><a target="_blank" href="http://codex.wordpress.org/Function_Reference/wp_register_script" target="_blank">wp_register_script</a><br /> <a target="_blank" href="http://codex.wordpress.org/Function_Reference/wp_deregister_script" target="_blank">wp_deregister_script</a><br /> <a target="_blank" href="http://codex.wordpress.org/Function_Reference/wp_enqueue_script" target="_blank">wp_enqueue_script</a><br /> <a target="_blank" href="http://codex.wordpress.org/Function_Reference/wp_register_style" target="_blank">wp_register_style</a><br /> <a target="_blank" href="http://codex.wordpress.org/Function_Reference/wp_enqueue_style" target="_blank">wp_enqueue_style</a><br /> <a target="_blank" href="http://codex.wordpress.org/Function_Reference/get_template_part" target="_blank">get_template_part</a></p><p><a href="http://think2loud.com/912-organize-your-wordpress-theme-in-3-easy-steps/">Organize your WordPress Theme in 3 Easy Steps</a></p>]]></content:encoded> <wfw:commentRss>http://think2loud.com/912-organize-your-wordpress-theme-in-3-easy-steps/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Awesome WordPress Feature of the Day: Add Theme Support</title><link>http://think2loud.com/855-awesome-wordpress-feature-day-add-theme-support/</link> <comments>http://think2loud.com/855-awesome-wordpress-feature-day-add-theme-support/#comments</comments> <pubDate>Thu, 19 Aug 2010 00:38:57 +0000</pubDate> <dc:creator>Jared</dc:creator> <category><![CDATA[WordPress]]></category><guid isPermaLink="false">http://think2loud.com/?p=855</guid> <description><![CDATA[<p>This has become one of my favorite features when I build a new WordPress theme. It seems like such a simple thing, but when I started coding my themes with this function in mind everything melds together so nicely. <a href="http://think2loud.com/855-awesome-wordpress-feature-day-add-theme-support/">Read More</a></p><p><a href="http://think2loud.com/855-awesome-wordpress-feature-day-add-theme-support/">Awesome WordPress Feature of the Day: Add Theme Support</a></p>]]></description> <content:encoded><![CDATA[<p>My favorite new function in WordPress is Add Theme Support.</p><p>As a developer, one of my favorite things to do is write reusable code.  I love when I start a theme and find it needs some bit of functionality that I wrote for something else, if all i need to do is include a file and make a couple strategic edit my job just got easier.  Here is a quick example.  Imagine you have a custom post type for events ( just an example, I have no code to back this up, sucks I know).  If you create your event post type in a class, you can use the current_theme_supports method to check and see if you need it, and your class does the rest!</p><div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>current_theme_supports<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'event-post-type'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;init&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;jmh_event_post_init&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> jmh_event_post_init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$event_class</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$event_class</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> event_post_class<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><p>So if you build a lot of themes, set up a single folder with an init file.  include all your files there, organize it, then your functions PHP will just need to start off with a couple things:</p><div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_theme_support<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'event-post-type'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'your init php file'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p><a href="http://think2loud.com/855-awesome-wordpress-feature-day-add-theme-support/">Awesome WordPress Feature of the Day: Add Theme Support</a></p>]]></content:encoded> <wfw:commentRss>http://think2loud.com/855-awesome-wordpress-feature-day-add-theme-support/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Enable Multi-Site in WordPress</title><link>http://think2loud.com/826-enable-multisite-wordpress/</link> <comments>http://think2loud.com/826-enable-multisite-wordpress/#comments</comments> <pubDate>Tue, 10 Aug 2010 16:38:53 +0000</pubDate> <dc:creator>Josh</dc:creator> <category><![CDATA[WordPress]]></category><guid isPermaLink="false">http://think2loud.com/?p=826</guid> <description><![CDATA[<p>WordPress merging with WordPress MU makes an awesome software package even better. The issue now is, how do you turn on the multi-site functionality? If you are like me and find yourself forgetting that one line of code needed to &#8230; <a href="http://think2loud.com/826-enable-multisite-wordpress/">Read More</a></p><p><a href="http://think2loud.com/826-enable-multisite-wordpress/">Enable Multi-Site in WordPress</a></p>]]></description> <content:encoded><![CDATA[<p>WordPress merging with WordPress MU makes an awesome software package even better. The issue now is, how do you turn on the multi-site functionality? If you are like me and find yourself forgetting that one line of code needed to kick off the setup of multi-site within WordPress. Then you made it to the right place, because for your benefit and mine I have taken the time to write down the steps involved. The first step is to install WordPress so be sure to head over to <a target="_blank" href="http://wordpress.org">WordPress.org</a> for the latest version and then do a standard install of WordPress. Once you have WordPress up and running you can enable multi-site in just a few quick steps.</p><h2>1. Add the following to the wp-config.php</h2><div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**   MULTI-SITE SETUP   */</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'WP_ALLOW_MULTISITE'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><h2>2. Navigate to Tools > Network and choose your install type</h2><p>You will have to choose what kind of network you want to run. Your choices are either Sub-directory setup or a Sub-domain setup. These choices affect how the addresses of your sites look.</p><p><strong>Sub-directory</strong><br /> This configuration means that all your blogs/sites created within WordPress are extensions of your domain. So if you were using the domain myawesomesite.com then your blogs/sites within WordPress would all have domains like:<br /> myawesomesite.com/siteone<br /> myawesomesite.com/sitetwo</p><p><strong>Sub-domain</strong><br /> This configuration does require some extra DNS work meaning you will need to setup a wildcard DNS record. With this setup each new blog/site in WordPress becomes it&#8217;s own sub-domain of the top level domain that was used to install WordPress. So if you installed WordPress on the url myawesomesite.com each new site&#8217;s domain would look like:<br /> siteone.myawesomesite.com<br /> sitetwo.myawesomesite.com</p><p>Once you have chosen the setup you want to run enter your network details and hit install.</p><h2>3. Finish up the network install</h2><p>There are a few things that you need to do manually to finish the install.</p><p><strong>Create the blogs.dir directory</strong><br /> Create a new directory in the wp-content folder called blogs.dir, this directory will be where all your sites uploaded content is stored.</p><p><strong>Edit wp-config.php</strong><br /> WordPress will generate some new settings for you to add to your config file. These settings are specific to your network. For the myawesomesite.com setup they would like this:</p><div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'MULTISITE'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'SUBDOMAIN_INSTALL'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$base</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'/'</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'DOMAIN_CURRENT_SITE'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'myawesomesite.com'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'PATH_CURRENT_SITE'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'/'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'SITE_ID_CURRENT_SITE'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'BLOG_ID_CURRENT_SITE'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p><strong>Edit or create the .htaccess file</strong><br /> If you already have a .htaccess file setup then you will just want to edit the area the contains WordPress rules. If you don&#8217;t have a .htaccess file go ahead and create one. Now all you have to do is copy in the settings provided by WordPress, save the file and you are done. This is an example of the code generated by WordPress:</p><div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">RewriteEngine On
RewriteBase <span style="color: #339933;">/</span>
RewriteRule ^index\<span style="color: #339933;">.</span>php$ <span style="color: #339933;">-</span> <span style="color: #009900;">&#91;</span>L<span style="color: #009900;">&#93;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># uploaded files
</span>RewriteRule ^<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>_0<span style="color: #339933;">-</span>9a<span style="color: #339933;">-</span>zA<span style="color: #339933;">-</span>Z<span style="color: #339933;">-</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">+/</span><span style="color: #009900;">&#41;</span>?files<span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">.+</span><span style="color: #009900;">&#41;</span> wp<span style="color: #339933;">-</span>includes<span style="color: #339933;">/</span>ms<span style="color: #339933;">-</span>files<span style="color: #339933;">.</span>php?<span style="color: #990000;">file</span><span style="color: #339933;">=</span>$<span style="color:#800080;">2</span> <span style="color: #009900;">&#91;</span>L<span style="color: #009900;">&#93;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># add a trailing slash to /wp-admin
</span>RewriteRule ^<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>_0<span style="color: #339933;">-</span>9a<span style="color: #339933;">-</span>zA<span style="color: #339933;">-</span>Z<span style="color: #339933;">-</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">+/</span><span style="color: #009900;">&#41;</span>?wp<span style="color: #339933;">-</span>admin$ $1wp<span style="color: #339933;">-</span>admin<span style="color: #339933;">/</span> <span style="color: #009900;">&#91;</span>R<span style="color: #339933;">=</span><span style="color: #cc66cc;">301</span><span style="color: #339933;">,</span>L<span style="color: #009900;">&#93;</span>
&nbsp;
RewriteCond <span style="color: #339933;">%</span><span style="color: #009900;">&#123;</span>REQUEST_FILENAME<span style="color: #009900;">&#125;</span> <span style="color: #339933;">-</span>f <span style="color: #009900;">&#91;</span>OR<span style="color: #009900;">&#93;</span>
RewriteCond <span style="color: #339933;">%</span><span style="color: #009900;">&#123;</span>REQUEST_FILENAME<span style="color: #009900;">&#125;</span> <span style="color: #339933;">-</span>d
RewriteRule ^ <span style="color: #339933;">-</span> <span style="color: #009900;">&#91;</span>L<span style="color: #009900;">&#93;</span>
RewriteRule  ^<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>_0<span style="color: #339933;">-</span>9a<span style="color: #339933;">-</span>zA<span style="color: #339933;">-</span>Z<span style="color: #339933;">-</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">+/</span><span style="color: #009900;">&#41;</span>?<span style="color: #009900;">&#40;</span>wp<span style="color: #339933;">-</span><span style="color: #009900;">&#40;</span>content<span style="color: #339933;">|</span>admin<span style="color: #339933;">|</span>includes<span style="color: #009900;">&#41;</span><span style="color: #339933;">.*</span><span style="color: #009900;">&#41;</span> $<span style="color:#800080;">2</span> <span style="color: #009900;">&#91;</span>L<span style="color: #009900;">&#93;</span>
RewriteRule  ^<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>_0<span style="color: #339933;">-</span>9a<span style="color: #339933;">-</span>zA<span style="color: #339933;">-</span>Z<span style="color: #339933;">-</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">+/</span><span style="color: #009900;">&#41;</span>?<span style="color: #009900;">&#40;</span><span style="color: #339933;">.*</span>\<span style="color: #339933;">.</span>php<span style="color: #009900;">&#41;</span>$ $<span style="color:#800080;">2</span> <span style="color: #009900;">&#91;</span>L<span style="color: #009900;">&#93;</span>
RewriteRule <span style="color: #339933;">.</span> index<span style="color: #339933;">.</span>php <span style="color: #009900;">&#91;</span>L<span style="color: #009900;">&#93;</span></pre></div></div><h2>4. Remove the Tools > Network menu option</h2><p>Once you have your network setup you can remove the menu option simple by commenting out the enable multi-site option in your wp-config.php file.</p><div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**   MULTI-SITE SETUP   */</span>
<span style="color: #666666; font-style: italic;">//define('WP_ALLOW_MULTISITE', true);</span></pre></div></div><p><a href="http://think2loud.com/826-enable-multisite-wordpress/">Enable Multi-Site in WordPress</a></p>]]></content:encoded> <wfw:commentRss>http://think2loud.com/826-enable-multisite-wordpress/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>First Impressions: Genesis Theme Framework</title><link>http://think2loud.com/772-impressions-genesis-theme-framework/</link> <comments>http://think2loud.com/772-impressions-genesis-theme-framework/#comments</comments> <pubDate>Tue, 20 Jul 2010 11:00:24 +0000</pubDate> <dc:creator>Jared</dc:creator> <category><![CDATA[WordPress]]></category><guid isPermaLink="false">http://think2loud.com/?p=772</guid> <description><![CDATA[<p>Lately I&#8217;ve been doing a lot more work with WordPress, and it&#8217;s given me the opportunity to work on lots of different themes and theme frameworks. Given the choice I would much rather start a new theme from scratch. Of &#8230; <a href="http://think2loud.com/772-impressions-genesis-theme-framework/">Read More</a></p><p><a href="http://think2loud.com/772-impressions-genesis-theme-framework/">First Impressions: Genesis Theme Framework</a></p>]]></description> <content:encoded><![CDATA[<p>Lately I&#8217;ve been doing a lot more work with WordPress, and it&#8217;s given me the opportunity to work on lots of different themes and theme frameworks.  Given the choice I would much rather start a new theme from scratch.  Of course &#8220;from scratch&#8221; means using one of the many starter themes people have put together, recently my favorite being BLANK from the Digging into WordPress <a target="_blank" href="http://themeclubhouse.digwp.com/" target="_blank">Theme Clubhouse</a>. However when working in a production environment I&#8217;ve found it beneficial to find a framework and stick with it.  That way projects get done faster, everyone uses the same codebase, and clients all get a similar experience.</p><p>Enter the Genesis Framework from <a target="_blank" href="http://www.studiopress.com/themes/genesis" target="_blank">StudioPress</a>.  As soon as I got a look at how the framework is built I was instantly impressed.  First, it has several great features that are helpful to both developers and users.  It offers automatic updates, great security, customizable theme settings, custom widgets, plenty of layout options, and the list goes on.  There are a lot of frameworks out there that give you similar things, but Genesis has some really cool features for developers too.</p><p>For starters, the theme is fully compatible with all the new features in WordPress 3.0.  StudioPress was quick to add those features for their users, and that kind of dedication to their product is a huge value.  Another great value for developers is the themes construction.  They have built Genesis to be a starting point for child themes, allowing for radically different sites without having to do the same edits to the main theme over and over again.  To help make a child theme as customizable as it needs to be in order to be successful, they have built in plenty of hooks to do whatever you need.  If you want to add a widgetized area above the footer, it&#8217;s easy.  You need an add area above the content, it can be done.  Anything you can think of you can do.  Proof of this is easy enough to find, since from what I can tell every theme that StudioPress has available is a child theme of Genesis.</p><p>On top of all this, StudioPress has an active community of users and developers on their forums that can offer help to any problems people come up with.  I think anyone who really uses WordPress knows how important an active community can be.</p><p>To wrap this up, I can simplify my first impressions into one word : awesome.  I&#8217;m really looking forward to building some cool stuff on top of this theme framework, and when I do i&#8217;ll be back writing a post about it.</p><p><a href="http://think2loud.com/772-impressions-genesis-theme-framework/">First Impressions: Genesis Theme Framework</a></p>]]></content:encoded> <wfw:commentRss>http://think2loud.com/772-impressions-genesis-theme-framework/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Displaying custom post types on your WordPress blog homepage</title><link>http://think2loud.com/763-displaying-custom-post-types-wordpress-blog-homepage/</link> <comments>http://think2loud.com/763-displaying-custom-post-types-wordpress-blog-homepage/#comments</comments> <pubDate>Fri, 16 Jul 2010 02:29:31 +0000</pubDate> <dc:creator>Josh</dc:creator> <category><![CDATA[WordPress]]></category><guid isPermaLink="false">http://think2loud.com/?p=763</guid> <description><![CDATA[<p>So you have created a great new custom post type in WordPress 3.0 but it doesn&#8217;t show on your homepage. To add your new post type to the homepage you could use the following code in your functions.php. As you &#8230; <a href="http://think2loud.com/763-displaying-custom-post-types-wordpress-blog-homepage/">Read More</a></p><p><a href="http://think2loud.com/763-displaying-custom-post-types-wordpress-blog-homepage/">Displaying custom post types on your WordPress blog homepage</a></p>]]></description> <content:encoded><![CDATA[<p>So you have created a great new custom post type in WordPress 3.0 but it doesn&#8217;t show on your homepage. To add your new post type to the homepage you could use the following code in your functions.php. As you can see this code sets all the post types you would like to have displayed by using the pre_get_posts filter. I think using the filter would be great but currently it breaks the new menu&#8217;s in WordPress 3.0.</p><div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_filter<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'pre_get_posts'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_get_posts'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> my_get_posts<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$query</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> is_home<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
		<span style="color: #000088;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'post_type'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'post'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'page'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'album'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'movie'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'quote'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'attachment'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$query</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><p>So to add your custom post types into the your blog homepage you can put this code just before the WordPress post loop. The following code adds in the post types you would like to use and also checks to make sure your paging still works.</p><div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> is_home<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$paged</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>get_query_var<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'paged'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> ? get_query_var<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'paged'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
query_posts<span style="color: #009900;">&#40;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'post_type'</span><span style="color: #339933;">=&gt;</span>array<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'post'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'linkpost'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'paged'</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$paged</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div><p>if you want to read more about the first piece of code you can check it out on <a target="_blank" href="http://justintadlock.com/archives/2010/02/02/showing-custom-post-types-on-your-home-blog-page">Justin Tadlock&#8217;s</a> blog.</p><p><a href="http://think2loud.com/763-displaying-custom-post-types-wordpress-blog-homepage/">Displaying custom post types on your WordPress blog homepage</a></p>]]></content:encoded> <wfw:commentRss>http://think2loud.com/763-displaying-custom-post-types-wordpress-blog-homepage/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>WordPress Hosting</title><link>http://think2loud.com/745-wordpress-hosting/</link> <comments>http://think2loud.com/745-wordpress-hosting/#comments</comments> <pubDate>Wed, 14 Jul 2010 02:58:35 +0000</pubDate> <dc:creator>Josh</dc:creator> <category><![CDATA[WordPress]]></category><guid isPermaLink="false">http://think2loud.com/?p=745</guid> <description><![CDATA[<p>Think2Loud had been on shared hosting for just under two years, before I finally decided to take the leap and set up my own server. A few months ago I was reading a blog post by WooThemes about their new &#8230; <a href="http://think2loud.com/745-wordpress-hosting/">Read More</a></p><p><a href="http://think2loud.com/745-wordpress-hosting/">WordPress Hosting</a></p>]]></description> <content:encoded><![CDATA[<p>Think2Loud had been on shared hosting for just under two years, before I finally decided to take the leap and set up my own server. A few months ago I was reading a blog post by <a target="_blank" href="http://www.woothemes.com/2010/04/our-setup/">WooThemes</a> about their new hosting setup. After reading about their insane hosting setup, I started doing a little research on <a target="_blank" href="http://www.vps.net/?r=clVz">VPS.net</a> and came across a great article on <a target="_blank" href="http://yoast.com">Yoast.com</a> about <a target="_blank" href="http://yoast.com/articles/wordpress-hosting/">WordPress hosting</a>. So going by what WooThemes had recently setup and what Yoast recommend, I moved Think2Loud to a <a target="_blank" href="http://www.vps.net/?r=clVz">VPS.net Cloud Server</a>. I couldn’t be happier with the results. Not only does VPS.net have a great product for hosting WordPress but they are also extremely helpful and quick to respond to questions. So if you are looking for new hosting, be sure to check out a <a target="_blank" href="http://www.vps.net/?r=clVz">VPS.net Cloud Server</a>.</p><h2>VPS.net WordPress Hosting</h2><p>Think2Loud doesn’t yet need the power that Yoast.com is running on. I got a VPS.net Cloud Server with the following setup on it, and what&#8217;s more, I did it all on my own. Yoast mentions in their WordPress article that if you buy 6 nodes or more, VPS.net will set you up with exactly what they have. Since Think2Loud currently only has about 15K visits a month, I couldn’t justify that much power. With some help from the VPS.net forums and following Yoast’s setup list, this is what I have running:</p><ul><li>1 Cloud Server at VPS.net, (2 nodes at the moment, tried 1 and there was just not enough RAM)</li><li>Centos with CPanel in the Atlanta cloud</li><li>replaced Apache with <a target="_blank" href="http://litespeedtech.com/">LiteSpeed</a> (this really is easy )</li><li>installed <a target="_blank" href="http://pecl.php.net/package/APC">APC</a> so I could do database and output caching with the <a target="_blank" href="http://www.w3-edge.com/wordpress-plugins/w3-total-cache/">W3 Total Cache plugin</a></li><li>and of course a CDN. I went with <a target="_blank" href="http://maxcdn.com">MaxCDN</a> because they were the best deal I could find</li></ul><p>Pretty simple, right? Now there are a few things that I would like to share with you about VPS.net and the setup they have. I couldn’t find this info anywhere on the web but you may find it valuable. I know it made my day once I signed up and got started.</p><ul><li>CPanel and WHM are monthly add-ons and VPS.net does the licensing.</li><li>LiteSpeed is also a monthly add-on and has a CPanel module. VPS.net also takes care of the license.</li><li>TThere is a small fee for there snapshot service. (Get it! you can never have too many backups).</li><li>I also setup Rsync on my server with the help of VPS.net. Again, there is a small fee, but it backs up everything.</li></ul><p>That&#8217;s it! With just a little work, you can have one lean, mean, WordPress hosting machine. Be sure to check out the <a target="_blank" href="http://yoast.com/articles/wordpress-hosting/">WordPress hosting</a> article over at Yoast.com, and I would like to thank them for pointing me to a great hosting service.</p><p><a href="http://think2loud.com/745-wordpress-hosting/">WordPress Hosting</a></p>]]></content:encoded> <wfw:commentRss>http://think2loud.com/745-wordpress-hosting/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>How to see if a Post in WordPress has an Excerpt</title><link>http://think2loud.com/723-check-post-wordpress-excerpt/</link> <comments>http://think2loud.com/723-check-post-wordpress-excerpt/#comments</comments> <pubDate>Fri, 09 Jul 2010 02:33:55 +0000</pubDate> <dc:creator>Josh</dc:creator> <category><![CDATA[WordPress]]></category> <category><![CDATA[quicktip]]></category><guid isPermaLink="false">http://think2loud.com/?p=723</guid> <description><![CDATA[<p>On the single post page for our posts, we wanted to display the excerpt only if one had been entered. Since the built-in WordPress function to get the excerpt for a post will automatically generate one for you, we couldn’t &#8230; <a href="http://think2loud.com/723-check-post-wordpress-excerpt/">Read More</a></p><p><a href="http://think2loud.com/723-check-post-wordpress-excerpt/">How to see if a Post in WordPress has an Excerpt</a></p>]]></description> <content:encoded><![CDATA[<p>On the single post page for our posts, we wanted to display the excerpt only if one had been entered. Since the built-in WordPress function to get the excerpt for a post will automatically generate one for you, we couldn’t just put the function in our post loop like what was done below.</p><div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span> have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
	&lt;div id=&quot;post-<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_ID<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; <span style="color: #000000; font-weight: bold;">&lt;?php</span> post_class<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&gt;
		&lt;h1 class=&quot;entry-title&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/h1&gt;
		&lt;div class=&quot;entry-content&quot;&gt;
			<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_excerpt<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_content<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
		&lt;/div&gt;&lt;!-- .entry-content --&gt;
	&lt;/div&gt;&lt;!-- #post --&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// end of the loop. ?&gt;</span></pre></div></div><p>Doing this causes the intro of the post to show twice, once from the auto-generated excerpt and once in the post content. To fix this, we added a quick check to the post loop. Simply replacing the_excerpt function in the post loop with this little piece of code removed the double intro.</p><div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_excerpt</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">//We have a excerpt so print it</span>
		the_excerpt<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> 
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div><p><a href="http://think2loud.com/723-check-post-wordpress-excerpt/">How to see if a Post in WordPress has an Excerpt</a></p>]]></content:encoded> <wfw:commentRss>http://think2loud.com/723-check-post-wordpress-excerpt/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Harness the Power of the WordPress Post Class Function and Style Those Sticky Posts</title><link>http://think2loud.com/512-harness-the-power-of-the-wordpress-post-class-function-and-style-those-sticky-posts/</link> <comments>http://think2loud.com/512-harness-the-power-of-the-wordpress-post-class-function-and-style-those-sticky-posts/#comments</comments> <pubDate>Wed, 12 Aug 2009 02:22:24 +0000</pubDate> <dc:creator>Josh</dc:creator> <category><![CDATA[WordPress]]></category><guid isPermaLink="false">http://think2loud.com/?p=512</guid> <description><![CDATA[<p>The sticky post functionality in WordPress uses the post class function introduced in WordPress 2.7 to style your sticky post with css. In order to have your sticky posts styled different than your regular posts, you need to have the post class function in your theme within the post loop. <a href="http://think2loud.com/512-harness-the-power-of-the-wordpress-post-class-function-and-style-those-sticky-posts/">Read More</a></p><p><a href="http://think2loud.com/512-harness-the-power-of-the-wordpress-post-class-function-and-style-those-sticky-posts/">Harness the Power of the WordPress Post Class Function and Style Those Sticky Posts</a></p>]]></description> <content:encoded><![CDATA[<h2>What is a sticky post and why would I use it?</h2><p>A sticky post is a post that is plucked out from its publish date and moved to the front of your blog. This will keep the post on your homepage so you can increase the visibility of that post. Sticky posts have many uses&#8211;one would be if you were having a giveaway. You could stick that post to your homepage so everyone would see it when they visit your blog. Then, once the contest is over, you remove the sticky post option and the post falls back in line to when it was published.</p><h2>Adding the post class function to your theme</h2><p>Within the post loop there should be some code that looks something like what is below:</p><div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;div id=&quot;post-<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_ID<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; class=&quot;post&quot;&gt;
	Rest of loop here
&lt;div&gt;</pre></div></div><p>Now some themes use more than one class to style their posts. You could have a setup like the following where you have not only a post class but also a box class. Thankfully for you they have made it very easy to add that class into the post_class function.</p><div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;div id=&quot;post-<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_ID<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; class=&quot;post box&quot;&gt;
	Rest of loop here
&lt;div&gt;</pre></div></div><p>To update the theme all we need to do is replace class=&#8221;post&#8221; with our function call. Your updated post loop will now look like.</p><div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;div id=&quot;post-<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_ID<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; <span style="color: #000000; font-weight: bold;">&lt;?php</span> post_class<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&gt;
	Rest of loop here
&lt;div&gt;</pre></div></div><p>If you need that extra class like the second example that also uses the box class. All you need to do is pass that class name into the post class function.</p><div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;div id=&quot;post-<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_ID<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; <span style="color: #000000; font-weight: bold;">&lt;?php</span> post_class<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'box'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&gt;
	Rest of loop here
&lt;div&gt;</pre></div></div><p>That is it for updating the code within your theme.</p><h2>Adding style to your sticky post</h2><p>The post class function will automatically add a class of sticky to any post marked as such in the post admin screen. So in your style sheet you will need to add some styles for this new class. Here we just added a different background color to our sticky posts.</p><div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">.sticky<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#c2c2c2</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div><h2>Marking a post as sticky</h2><div class="fl pic2"><img src="http://zippy.think2loud.com/wp-content/uploads/2009/08/stick-post-edit-window1.png" alt="stick-post-edit-window.png" border="0" width="280" height="306" /></div><p>In WordPress 2.8, make your way to the edit screen for the post you would like to make sticky. You&#8217;ll then see a box like the one to the left with the visibilty section closed. Click the edit link and you will now see the checkbox. That&#8217;s all it takes to take advantage of sticky posts in WordPress.</p><p class="clear">Be sure to check out the <a target="_blank" href="http://codex.wordpress.org/Main_Page" target="_blank">WordPress Codex</a> to find more info on all the functions available in WordPress.</p><p><a href="http://think2loud.com/512-harness-the-power-of-the-wordpress-post-class-function-and-style-those-sticky-posts/">Harness the Power of the WordPress Post Class Function and Style Those Sticky Posts</a></p>]]></content:encoded> <wfw:commentRss>http://think2loud.com/512-harness-the-power-of-the-wordpress-post-class-function-and-style-those-sticky-posts/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Served from: think2loud.com @ 2012-02-03 21:59:55 by W3 Total Cache -->
