<?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>Six Revisions &#187; WordPress</title>
	<atom:link href="http://sixrevisions.com/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://sixrevisions.com</link>
	<description></description>
	<lastBuildDate>Fri, 18 May 2012 00:25:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>20 Free Contact Form Plugins for WordPress</title>
		<link>http://sixrevisions.com/wordpress/free-contact-form-plugins/</link>
		<comments>http://sixrevisions.com/wordpress/free-contact-form-plugins/#comments</comments>
		<pubDate>Fri, 02 Sep 2011 10:00:59 +0000</pubDate>
		<dc:creator>Jacob Gube</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://sixrevisions.com/?p=5840</guid>
		<description><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5840&c=1313175149' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5840&c=1313175149' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br />Setting up a web form that your site visitors can use to send you a message can be a challenging task for some. For sites using WordPress, however, this tedious job can easily be accomplished by the use of a WordPress plugin. Let&#8217;s take a look at some free contact form plugins for WordPress. 1. [...]]]></description>
			<content:encoded><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5840&c=1924424352' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5840&c=1924424352' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br /><p><a href="http://sixrevisions.com/wordpress/free-contact-form-plugins/"><img src="http://cdn.sixrevisions.com/0192-01_wordpress_contactform_plugins_thumbnail.jpg" width="550" height="200" alt="20 Free Contact Form Plugins for WordPress" /></a></p>
<p>Setting up a web form that your site visitors can use to send you a message can be a challenging task for some. For sites using WordPress, however, this tedious job can easily be accomplished by the use of a WordPress plugin.</p>
<p>Let&#8217;s take a look at some free contact form plugins for WordPress.</p>
<p><span id="more-5840"></span></p>
<h3>1. <a href="http://wordpress.org/extend/plugins/contact-coldform/">Contact Coldform</a></h3>
<p><a href="http://wordpress.org/extend/plugins/contact-coldform/"><img src="http://cdn.sixrevisions.com/0192-02_contact_coldform.png" width="550" height="337" /></a></p>
<p>Contact Coldform is an easy-to-use, no-nonsense contact form plugin that&#8217;s very customizable. You can add a contact form to any given page or post using a simple <a href="http://codex.wordpress.org/Shortcode_API" target="_blank" title="Shortcode API - wordpress.org">shortcode</a>. One thing to note about this plugin, though, is that its update frequency is slower than the other plugins.</p>
<h3>2. <a href="http://wordpress.org/extend/plugins/contact-form-7/">Contact Form 7</a></h3>
<p><a href="http://wordpress.org/extend/plugins/contact-form-7/"><img src="http://cdn.sixrevisions.com/0192-03_contact_form_7.png" width="550" height="369" alt="Contact Form 7" /></a></p>
<p>Contact Form 7 is one of the most used contact form plugins for WordPress. It supports Ajax filtering, the ability to challenge form submissions using CAPTCHAs and spam filtering integrated with the well-known Akismet WordPress plugin. While Contact Form 7 offers many useful features, its UI may seem daunting to non-developers.</p>
<h3>3. <a href="http://wordpress.org/extend/plugins/contactme/">Contact Form by ContactMe.com</a></h3>
<p><a href="http://wordpress.org/extend/plugins/contactme/"><img src="http://cdn.sixrevisions.com/0192-04_contactme_form.png" width="550" height="473" /></a></p>
<p>Contact Form by ContactMe.com is yet another feature-rich contact form plugin for WordPress. The plugin offers three variants: two paid plans and a free plan. The free version allows you to create a contact form for your WordPress-powered site, but lacks some features (such as the ability to attach files) and has a limit of one contact form per site. Once installed, you&#8217;ll need to provide your email address in order to create an account on <a href="http://www.contactme.com/">ContactMe.com.</a></p>
<h3>4. <a href="http://wordpress.org/extend/plugins/custom-contact-forms/">Custom Contact Forms</a></h3>
<p><a href="http://wordpress.org/extend/plugins/custom-contact-forms/"><img src="http://cdn.sixrevisions.com/0192-05_custom_contact_form.png" width="550" height="267" /></a></p>
<p>Custom Contact Forms is one of the most feature-rich and customizable contact form plugins out there. It lets you tweak many aspects of your web form and allows you to create custom &quot;thank you&quot; pages after the form has been submitted.</p>
<h3>5. <a href="http://wordpress.org/extend/plugins/si-contact-form/">Fast Secure Contact Form</a></h3>
<p><a href="http://wordpress.org/extend/plugins/si-contact-form/"><img src="http://cdn.sixrevisions.com/0192-06_fast_secure_contact_form.png" width="550" height="449" /></a></p>
<p>Fast Secure Contact Form lets you create an unlimited number of contact forms. It has support for file uploading, with the option of restricting the type and size of the files that could be uploaded. The plugin additionally offers Akismet integration for spam protection, database backups of submitted contact forms, auto-responder emails that are sent after a contact form is submitted and more.</p>
<h3>6. <a href="http://wordpress.org/extend/plugins/onw-simple-contact-form/">ONW Simple Contact Form</a></h3>
<p><a href="http://wordpress.org/extend/plugins/onw-simple-contact-form/"><img src="http://cdn.sixrevisions.com/0192-07_onw_simple_contact_form.png" width="550" height="402" alt="ONW Simple Contact Form" /></a></p>
<p>ONW Simple Contact Form is a straightforward contact form plugin. You can configure it to work with <a href="http://www.recaptcha.net/">reCaptcha</a>. Apart from being able to create contact forms using shortcodes, ONW Simple Contact Form also adds a button to the WordPress visual editor that lets you insert contact forms while composing posts and pages.</p>
<h3>7. <a href="http://wordpress.org/extend/plugins/simplemodal-contact-form-smcf/">SimpleModal Contact Form (SMCF)</a></h3>
<p><a href="http://wordpress.org/extend/plugins/simplemodal-contact-form-smcf/"><img src="http://cdn.sixrevisions.com/0192-08_simple_modal_contact_form.png" width="550" height="288" /></a></p>
<p>SimpleModal Contact Form is a modal-window contact form that uses jQuery. SMCF can be configured to provide you with the contact form submitter&#8217;s IP address as well as the option to send the contact form user a copy of their own message.</p>
<h3>8. <a href="http://wordpress.org/extend/plugins/slick-contact-forms/">Slick Contact Forms</a></h3>
<p><a href="http://wordpress.org/extend/plugins/slick-contact-forms/"><img src="http://cdn.sixrevisions.com/0192-09_slick_contact_forms.jpg" width="550" height="286" alt="Slick Contact Forms" /></a></p>
<p>Slick Contact Forms is a WordPress plugin that creates a widget that can be used to add multiple contact forms on a web page. The forms can be floating, dropdown, sticky or even sliding in appearance.</p>
<h3>9. <a href="http://wordpress.org/extend/plugins/wp-flex-contact-form/">WP Flex Contact Form</a></h3>
<p><a href="http://wordpress.org/extend/plugins/wp-flex-contact-form/"><img src="http://cdn.sixrevisions.com/0192-10_wp_flex_contact_forms.png" width="550" height="297" alt="WP Flex Contact Form" /></a></p>
<p>WP Flex Contact Form is a WordPress plugin made in Flex/Flash. It claims to reduce spam messages because most spam bots can&#8217;t deal with Flash. You can tweak the background color of the form and set custom error messages.</p>
<h3>10. <a href="http://wordpress.org/extend/plugins/a-lead-capture-contact-form-and-tab-button-by-awebvoicecom/">A Capture Contact Form</a></h3>
<p><a href="http://wordpress.org/extend/plugins/a-lead-capture-contact-form-and-tab-button-by-awebvoicecom/"><img src="http://cdn.sixrevisions.com/0192-11_a_capture_contact_form.jpg" width="550" height="369" alt="A Capture Contact Form" /></a></p>
<p>This contact form WordPress plugin lets you add a contact tab on your website. You will need an account with <a href="http://www.awebvoice.com/">AWebVoice</a> in order to use the plugin.</p>
<h3>11. <a href="http://wordpress.org/extend/plugins/simple-contact-form/">Simple Contact Form</a></h3>
<p><a href="http://wordpress.org/extend/plugins/simple-contact-form/"><img src="http://cdn.sixrevisions.com/0192-12_simple_contact_form.png" width="550" height="267" alt="Simple Contact Form" /></a></p>
<p>Simple Contact Form is a plugin that lets you add contact forms in any area of your WordPress theme. It uses Ajax to avoid page reloads, making the experience of using your contact web forms smoother and quicker.</p>
<h3>12. <a href="http://wordpress.org/extend/plugins/super-contact-form/">Super Contact Form</a></h3>
<p><a href="http://wordpress.org/extend/plugins/super-contact-form/"><img src="http://cdn.sixrevisions.com/0192-13_super_contact_form.png" width="550" height="264" alt="Super Contact Form" /></a></p>
<p>Super Contact Form is a small plugin that&#8217;s also super simple to use. You just need to specify your email address in the WordPress admin panel after it has been installed. A word of caution: the <a href="http://wordpress.org/tags/super-contact-form?forum_id=10">reviews of this plugin</a> at WordPress.org  are not very encouraging.</p>
<h3>13. <a href="http://wordpress.org/extend/plugins/visitorcontact/">Visitor Contact Forms</a></h3>
<p><a href="http://wordpress.org/extend/plugins/visitorcontact/"><img src="http://cdn.sixrevisions.com/0192-14_visitor_contact_forms.png" width="550" height="323" alt="Visitor Contact Forms" /></a></p>
<p>Notable features of this WordPress plugin are geolocation (which helps determine where people are from) and integration with Google Maps. However, like Akismet, it requires you to create an account at the <a href="http://www.visitorcontact.com/">plugin&#8217;s website</a> to get your Form ID (it&#8217;s needed to activate and use the plugin).</p>
<h3>14. <a href="http://wordpress.org/extend/plugins/wd3k-ajax-sliding-contact-form/">WD3K Ajax Sliding Contact Form</a></h3>
<p><a href="http://wordpress.org/extend/plugins/wd3k-ajax-sliding-contact-form/"><img src="http://cdn.sixrevisions.com/0192-15_wd3k_ajax_sliding_contact_form.png" width="550" height="312" alt="WD3K Ajax Sliding Contact Form" /></a></p>
<p>WD3K is an Ajax-powered contact form that uses the <a href="http://theodin.co.uk/blog/ajax/contactable-jquery-plugin.html">Contactable</a> jQuery plugin. If you wish to add a sliding contact form that&#8217;s persistently displayed in your WordPress theme, you should definitely give this plugin a shot.</p>
<h3>15. <a href="http://wordpress.org/extend/plugins/rejected-magic-contact-rejected/">Magic Contact</a></h3>
<p><a href="http://wordpress.org/extend/plugins/rejected-magic-contact-rejected/"><img src="http://cdn.sixrevisions.com/0192-16_magic_contact.png" width="550" height="301" alt="Magic Contact" /></a></p>
<p>Magic Contact is an Ajax-powered plugin that is similar to WD3K Ajax Sliding Contact Form above.</p>
<h3>16. <a href="http://wordpress.org/extend/plugins/easy-contact/">Easy Contact</a></h3>
<p><a href="http://wordpress.org/extend/plugins/easy-contact/"><img src="http://cdn.sixrevisions.com/0192-17_easy_contact.png" width="550" height="352" alt="Easy Contact" /></a></p>
<p>Easy Contact, partly based on <a href="http://wordpress.org/extend/plugins/wp-contact-form/">WP Contact Form</a>, is a WordPress contact form plugin that has a GUI for customizing your contact form, the ability to use shortcodes so that you can embed your form using the WordPress editor without modifying your theme files and information-gathering options for tracking your contact form user&#8217;s referrer, browser type and IP address.</p>
<h3>17. <a href="http://wordpress.org/extend/plugins/enhanced-wordpress-contactform/">Enhanced WP Contact Form</a></h3>
<p><a href="http://wordpress.org/extend/plugins/enhanced-wordpress-contactform/"><img src="http://cdn.sixrevisions.com/0192-18_enhanced_wp_contact_form.png" width="550" height="339" alt="Enhanced WP Contact Form" /></a></p>
<p>This contact form plugin was developed by Joost de Valk, a well-known plugin author in the WordPress community. He&#8217;s authored plugins such as <a href="http://yoast.com/wordpress/seo/">WordPress SEO Plugin</a> and the Google Analytics plugin for WordPress.</p>
<h3>18. <a href="http://wordpress.org/extend/plugins/usernoise/">Usernoise Modal Feedback/Contact Form</a></h3>
<p><a href="http://wordpress.org/extend/plugins/usernoise/"><img src="http://cdn.sixrevisions.com/0192-19_usernoise_contact_form.png" width="550" height="278" alt="Usernoise Modal Feedback/Contact Form" /></a></p>
<p>This contact form plugin adds a persistent &quot;Feedback&quot; button at the side of your WordPress theme&#8217;s layout that, when clicked, displays a slick modal-window web form. It&#8217;s a plug-and-play contact form with minimal setup involved (it even inherits your theme&#8217;s typography automatically).</p>
<h3>19. <a href="http://wordpress.org/extend/plugins/cool-contact-form/">Cool Contact Form</a></h3>
<p><a href="http://wordpress.org/extend/plugins/cool-contact-form/"><img src="http://cdn.sixrevisions.com/0192-20_cool_contact_form.png" width="550" height="311" alt="Cool Contact Form" /></a></p>
<p>Cool Contact Form uses client-side (JavaScript) validation for quickly catching input errors. You&#8217;ll need to know CSS and you&#8217;ll be required to modify your WordPress theme&#8217;s style sheets in order to customize the look-and-feel of your contact forms.</p>
<h3>20. <a href="http://wordpress.org/extend/plugins/grunion-contact-form/">Grunion Contact Form</a></h3>
<p>This plugin is a simple, no-frills way of integrating a contact form into your WordPress site. You can create contact forms using shortcodes so there&#8217;s no need to modify your WordPress theme files.</p>
<h3>Related Content</h3>
<ul>
<li><a href="http://sixrevisions.com/wordpress/seo-plugins/">8 Excellent WordPress SEO Plugins</a></li>
<li><a href="http://sixrevisions.com/tutorials/web-development-tutorials/using-xampp-for-local-wordpress-theme-development/">Using XAMPP for Local WordPress Theme Development</a></li>
<li><a href="http://sixrevisions.com/wordpress/fine-tuning-wordpress-seo/">Fine-Tuning WordPress for SEO</a></li>
<li><em>Related categories</em>: <a href="http://sixrevisions.com/category/wordpress/">WordPress</a> and <a href="http://sixrevisions.com/category/website-management/">Website Management</a></li>
</ul>
<h3>About the Author</h3>
<p class="about-author"><img src="http://cdn.sixrevisions.com/authors/sufyan_bin_uzayr_small.jpg" alt="" width="80" height="80" /><span class="author-bio-text"><strong>Sufyan bin Uzayr</strong> is a 20-year old freelance writer, graphic artist, programmer and photographer based in India. He writes for several print magazines as well as technology blogs. He is also the editor of an e-journal named <a href="http://www.bravenewworld.in/">Brave New World</a>. You can visit his <a href="http://www.sufyan.co.nr/">website</a> as well as friend him on <a href="http://www.facebook.com/sufyanism">Facebook</a> and <a href="http://plus.google.com/103562130584894873663/">Google+</a>.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://sixrevisions.com/wordpress/free-contact-form-plugins/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>8 Excellent WordPress Caching Plugins to Speed Up Your Site</title>
		<link>http://sixrevisions.com/wordpress/caching-plugins/</link>
		<comments>http://sixrevisions.com/wordpress/caching-plugins/#comments</comments>
		<pubDate>Wed, 10 Aug 2011 10:00:18 +0000</pubDate>
		<dc:creator>Jacob Gube</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://sixrevisions.com/?p=5730</guid>
		<description><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5730&c=2108012397' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5730&c=2108012397' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br />If you use WordPress as your publishing platform and are concerned about speeding up your website, caching will help you. The faster a web page loads, the better the user experience is. This is how WordPress caching works: it generates a copy of your web pages and stores them in your server as static files [...]]]></description>
			<content:encoded><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5730&c=157690919' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5730&c=157690919' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br /><p><a href="http://sixrevisions.com/wordpress/caching-plugins/"><img src="http://cdn.sixrevisions.com/0176-01_wordpress_caching_plugins_thumbnail.jpg" width="550" height="200" alt="8 Excellent WordPress Caching Plugins to Speed Up Your Site" /></a></p>
<p>If you use <a href="http://sixrevisions.com/category/wordpress/" title="WordPress category on Six Revisions">WordPress</a> as your publishing platform and are concerned about <a href="http://sixrevisions.com/web-development/site-speed-performance/" title="10 Tips for Optimizing Your Website's Speed">speeding up your website</a>, <strong>caching</strong> will help you. The <a href="http://sixrevisions.com/web-development/decrease-webpage-load-times/" title="10 Tips for Decreasing Web Page Load Times">faster a web page loads</a>, the better the user experience is.</p>
<p>This is how <a href="http://codex.wordpress.org/WordPress_Optimization/Caching" target="_blank" title="WordPress Optimization/Caching - wordpress.org">WordPress caching</a> works: it generates a copy of your web pages and stores them in your server as static files (i.e. as HTML documents) and/or cached database queries. Afterwards, when a site visitor arrives at a particular page, the server gives them the cached page rather than re-querying your database and dynamically generating it, thus speeding up <a href="http://sixrevisions.com/web-development/five-ways-to-speed-up-page-response-times/" title="Five Ways to Speed Up Page Response Times">page response times</a> and potentially reducing the server resources required for generating and serving a web page.</p>
<p><span id="more-5730"></span></p>
<p>For WordPress users, the easiest and quickest way to implement a caching system is by the use of a WordPress plugin.</p>
<p>There are several WordPress cache plugins out there, and below, you&#8217;ll find the most popular, highly recommended ones.</p>
<h3>1. <a href="http://wordpress.org/extend/plugins/db-cache-reloaded-fix/" target="_blank">DB Cache Reloaded Fix</a></h3>
<p><a href="http://wordpress.org/extend/plugins/db-cache-reloaded-fix/"><img src="http://cdn.sixrevisions.com/0176-02_db_cache.png" width="550" height="285" alt="DB Cache Reloaded Fix" /></a></p>
<p>DB Cache Reloaded Fix is a modified version of <a href="http://wordpress.org/extend/plugins/db-cache-reloaded/" target="_blank">DB Cache Reloaded</a>, patched for WordPress 3.1 compatibility. DB Cache Reloaded Fix caches the MySQL queries performed on your database to optimize the site&#8217;s speed.</p>
<p>While database query caching should suffice for most websites, and the plugin performs fairly well, it&#8217;s one of the newer WordPress caching plugins out there, so it hasn&#8217;t been field-tested by WordPress users as much as the other older plugins.</p>
<h3>2. <a href="http://marto.lazarov.org/plugins/hyper-cache-extended" target="_blank">Hyper Cache Extended</a></h3>
<p><a href="http://marto.lazarov.org/plugins/hyper-cache-extended"><img src="http://cdn.sixrevisions.com/0176-03_extended_cache.png" width="550" height="420" alt="Hyper Cache Extended" /></a></p>
<p>Hyper Cache Extended, as its name implies, is an extended version of the popular <a href="http://wordpress.org/extend/plugins/hyper-cache/" target="_blank">Hyper Cache</a> WordPress plugin.</p>
<p>This plugin offers numerous features, such as 404-error-page caching, support for mobile devices, and various compression options.</p>
<p>For mobile device support, I tried it on my testing site using a phone running Opera Mini and an iPhone, and the site loaded up in a snap in both mobile devices (almost thrice as fast as before.)</p>
<p>Hyper Cache Extended has a satisfied user base, as evidenced by the ratings at WordPress.org. In addition, the creator, <a href="http://marto.lazarov.org/">Mapto Lazarov</a>, encourages users of the plugin to email him issues and feedback &#8212; a reassuring sign that the plugin is, at present, well maintained by an enthusiastic and helpful web developer.</p>
<h3>3. <a href="http://wordpress.org/extend/plugins/quick-cache/">Quick Cache</a></h3>
<p><a href="http://wordpress.org/extend/plugins/quick-cache/"><img src="http://cdn.sixrevisions.com/0176-04_quick_cache.png" width="550" height="438" alt="Quick Cache" /></a></p>
<p>Quick Cache is a WordPress caching plugin designed by <a href="http://www.primothemes.com/">Primo Themes</a>. It&#8217;s lightweight and has user-friendliness as one of its selling points. The admin interface itself outlines each option in fine detail so that you know exactly what each option does.</p>
<p>Quick Cache has an impressive list of useful options, including the ability to disable caching for logged-in users and users who have just posted a comment so they can see new comments right away, which is helpful if your site is very active.</p>
<h3>4. <a href="http://www.w3-edge.com/wordpress-plugins/w3-total-cache/">W3 Total Cache</a></h3>
<p><a href="http://www.w3-edge.com/wordpress-plugins/w3-total-cache/"><img src="http://cdn.sixrevisions.com/0176-05_w3_total_cache.jpg" width="550" height="433" alt="W3 Total Cache" /></a></p>
<p>W3 Total Cache is the most popularly known caching plugin for WordPress. It&#8217;s used by several leading WordPress-powered blogs such as Mashable and Smashing Magazine.</p>
<p>W3 Total Cache claims that your blog can load 10 times faster once the plugin is installed. Personally, I&#8217;ve seen the plugin drastically improve load times for older posts and static pages.</p>
<p>W3 Total Cache offers a plethora of options and provides you with other site optimization features such as source code minification and integration with your content delivery network (CDN).</p>
<p>If you&#8217;re uncomfortable with the admin interface (it can seem confusing for beginners), just leave the settings untouched because the plugin operates well at default settings.</p>
<h3>5. <a href="http://wordpress.org/extend/plugins/wp-cache/">WP-Cache</a></h3>
<p><a href="http://wordpress.org/extend/plugins/wp-cache/"><img src="http://cdn.sixrevisions.com/0176-06_wp_cache.png" width="550" height="493" alt="WP-Cache" /></a></p>
<p>WP-Cache is one of the first WordPress caching plugins, made available on WordPress.org in 2007 &#8212; so it has a relatively long track record. It gives you the ability to specify which posts, pages and files shouldn&#8217;t be cached.</p>
<p>The plugin operates well, but its update frequency is comparatively lower than the other plugins.</p>
<h3>6. <a href="http://wordpress.org/extend/plugins/wp-file-cache/">WP File Cache</a></h3>
<p><a href="http://wordpress.org/extend/plugins/wp-file-cache/"><img src="http://cdn.sixrevisions.com/0176-07_wp_file_cache.jpg" width="550" height="272" alt="WP File Cache" /></a></p>
<p>WP File Cache has a slightly different approach to WordPress caching: Instead of caching an entire web page, it only caches parts of it (usually parts that remain static for long periods of time).</p>
<p>Naturally, WP File Cache will not improve the performance and page load time of the website as much as the plugins that don&#8217;t require dynamic page generation and is best suited for high-traffic sites that frequently update web pages and WordPress users that would like to control which portions of a web page should (and shouldn&#8217;t) be cached.</p>
<h3>7. <a href="http://www.tankado.com/wp-simple-cache/">WP Simple Cache</a></h3>
<p><a href="http://www.tankado.com/wp-simple-cache/"><img src="http://cdn.sixrevisions.com/0176-08_wp_simple_cache.png" width="550" height="345" alt="WP Simple Cache" /></a></p>
<p>WP Simple Cache generates static HTML files of a WordPress site&#8217;s content. You can specify the timeout settings for cached pages and the auto-clean frequency of cache files. Other than that, as you can probably surmise from the plugin&#8217;s name, there aren&#8217;t many other options to tweak.</p>
<p>The plugin&#8217;s home page is in Turkish, so, unless you know Turkish, you shouldn&#8217;t expect plenty of documentation at your service.</p>
<h3>8. <a href="http://ocaoimh.ie/wp-super-cache/">WP Super Cache</a></h3>
<p><a href="http://ocaoimh.ie/wp-super-cache/"><img src="http://cdn.sixrevisions.com/0176-09_wp_super_cache.png" width="551" height="412" alt="WP Super Cache" /></a></p>
<p>WP Super Cache shows static HTML pages to most of your website&#8217;s visitors. The plugin developers claim that if your website gets a large amount of traffic and you&#8217;re on an underpowered web server, the plugin works wonders.</p>
<p>WP Super Cache can also cache certain WordPress plugins, which can also aid in improving site performance.</p>
<p>Six Revisions uses WP Super Cache, and recommends it as one of <a href="http://sixrevisions.com/wordpress/6-critical-wordpress-plugins-you-should-have-installed/" title="6 Critical WordPress Plugins You Should Have Installed">the six recommended plugins you should have installed</a>.</p>
<h3>Other WordPress Plugin Collections</h3>
<p>If you liked this post, here are other WordPress plugin collections you should read:</p>
<ul>
<li><a href="http://sixrevisions.com/wordpress/seo-plugins/">8 Excellent WordPress SEO Plugins</a></li>
<li><a href="http://sixrevisions.com/wordpress/10-wordpress-plugins-guaranteed-to-save-you-time/">10 WordPress Plugins Guaranteed to Save You Time</a></li>
<li><a href="http://sixrevisions.com/wordpress/top-5-excellent-e-commerce-plugins-for-wordpress/">Top 5 Excellent E-Commerce Plugins for WordPress</a></li>
<li><a href="http://sixrevisions.com/wordpress/6-critical-wordpress-plugins-you-should-have-installed/">6 Critical WordPress Plugins You Should Have Installed</a></li>
<li><a href="http://sixrevisions.com/resources/helpful_wordpress_plugins_advanced_users/">15 Helpful WordPress Plugins for the Savvy User</a></li>
</ul>
<h3>Related Content</h3>
<ul>
<li><a href="http://sixrevisions.com/wordpress/fine-tuning-wordpress-seo/">Fine-Tuning WordPress for SEO</a></li>
<li><a href="http://sixrevisions.com/wordpress/beginning-wordpress-development-a-look-at-common-functions/">Beginning WordPress Development: A Look at Common Functions</a></li>
<li><a href="http://sixrevisions.com/wordpress/taxonomy/">A Guide to WordPress Custom Taxonomy</a></li>
<li><em>Related categories</em>: <a href="http://sixrevisions.com/category/wordpress/">WordPress</a> and <a href="http://sixrevisions.com/category/website-management/">Website Management</a></li>
</ul>
<h3>About the Author</h3>
<p class="about-author"><img src="http://cdn.sixrevisions.com/authors/sufyan_bin_uzayr_small.jpg" alt="" width="80" height="80" /><span class="author-bio-text"><strong>Sufyan bin Uzayr</strong> is a 20-year old freelance writer, graphic artist, programmer and photographer based in India. He writes for several print magazines as well as technology blogs. He is also the editor of an e-journal named <a href="http://www.bravenewworld.in/">Brave New World</a>. You can visit his <a href="http://www.sufyan.co.nr/">website</a> as well as friend him on <a href="http://www.facebook.com/sufyanism">Facebook</a> and <a href="http://plus.google.com/103562130584894873663/">Google+</a>.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://sixrevisions.com/wordpress/caching-plugins/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>Fine-Tuning WordPress for SEO</title>
		<link>http://sixrevisions.com/wordpress/fine-tuning-wordpress-seo/</link>
		<comments>http://sixrevisions.com/wordpress/fine-tuning-wordpress-seo/#comments</comments>
		<pubDate>Fri, 15 Apr 2011 09:30:28 +0000</pubDate>
		<dc:creator>Jacob Gube</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://sixrevisions.com/?p=5251</guid>
		<description><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5251&c=1268874778' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5251&c=1268874778' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br />Just a few short years ago, building static websites by hand with HTML/CSS was the norm. Nowadays, WordPress powers almost 14% of all websites[1]. Originally developed as a blogging platform, WordPress has since morphed into a powerful content management system for all types of websites. But, as with most things that evolve from what they [...]]]></description>
			<content:encoded><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5251&c=1195281057' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5251&c=1195281057' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br /><p><a href="http://sixrevisions.com/wordpress/fine-tuning-wordpress-seo/"><img src="http://cdn.sixrevisions.com/0093-01_finetune_wordpress_seo_thumbnail.jpg" width="550" height="200" alt="Fine-Tuning WordPress for SEO" /></a></p>
<p>Just a few short years ago, building static websites by hand with HTML/CSS was the norm. Nowadays, WordPress powers almost 14% of all websites<sup>[<a href="#ref-01">1</a>]</sup>.</p>
<p>Originally developed as a blogging platform, WordPress has since morphed into a <a href="http://sixrevisions.com/web-development/how-to-evaluate-what-cms-to-use/" title="How to Evaluate What CMS to Use">powerful content management system</a> for all types of websites.</p>
<p>But, as with most things that evolve from what they were originally meant to do, there&#8217;s some fine-tuning that will be required to make them as functional as possible.</p>
<p><span id="more-5251"></span></p>
<p>While WordPress has top-notch SEO features out of the box, there a handful of things you can enhance to achieve even better SEO.  The following are some basic tips on how to fine-tune your WordPress site to attain improved search engine results ranking.</p>
<h3>Permalink Structure for URLs</h3>
<p>You can find the permalink settings under Setting &gt; Permalinks. The permalinks feature allows you to create custom URL structures for your WordPress content.</p>
<p>By default, WordPress sets your post URLs like so:</p>
<pre>http://example.com/?p=32</pre>
<p>From an SEO perspective, this is not ideal because you aren&#8217;t getting any benefit from having keywords in the URL, a known ranking factor for search engine results. </p>
<p>Some SEO professionals believe that the most effective structure is to have a single-level URL structure for your blog posts. For example, the first URL structure below is better than the second URL structure after it.</p>
<pre>http://example.com/<strong>the-post-name</strong>/</pre>
<p>versus:</p>
<pre>http://example.com/post-category/<strong>the-post-name</strong>/</pre>
<p>To have a single-level URL structure for your blog posts, first, in the Permalinks WordPress panel, choose custom the Custom Structure option. Then in the input field beside it, use the following URL structure:</p>
<pre>/%postname%/</pre>
<p><img src="http://cdn.sixrevisions.com/0093-02_wordpress_seo_permalinks.jpg" width="550" height="322" /></p>
<p>Once this option is set up properly, your URLs will appear like so:</p>
<pre>http://example.com/the-post-name/</pre>
<h3>Title Tags</h3>
<p>The <code>&lt;title&gt;</code> tag of your web pages is an important factor in SEO; <a href="http://sixrevisions.com/content-strategy/5-common-seo-mistakes-with-web-page-titles/" title="5 Common SEO Mistakes with Web Page Titles">all web pages should have a unique &lt;title&gt; tag.</a></p>
<p>In search engine results, the value of the <code>&lt;title&gt;</code> tag is often displayed after a user performs a search. For example, let&#8217;s say a user searched &quot;improve seo website&quot; on Google. The results page would look like this:</p>
<p><img src="http://cdn.sixrevisions.com/0093-03_wordpress_seo_serp.jpg" width="550" height="316" /></p>
<p>Notice that the first result is a blog post on Six Revisions called <a href="http://sixrevisions.com/web_design/improve-seo-website-design/">9 Ways To Improve the SEO of Every Website You Design</a>. The reason it appears like this on Google is because the <code>&lt;title&gt;</code> tag of the web page is:</p>
<pre>&lt;head&gt;
&lt;title&gt;<strong>9 Ways To Improve the SEO of Every Website You Design</strong>&lt;/title&gt;
&lt;/head&gt;</pre>
<p>By default, however, the <code>&lt;title&gt;</code> for your blog posts in WordPress is &quot;Blog name » Post title,&quot; and search engine users probably wouldn&#8217;t find that very compelling to click on.</p>
<p>For your WordPress site to get the most benefit out of its <code>&lt;title&gt;</code> tags, it should be altered by fronting-load keywords so that it can match with search terms that people use. This means having the post title come before the blog&#8217;s name.</p>
<p>To change your <code>&lt;title&gt;</code> tags, I recommend installing the <a href="http://wordpress.org/extend/plugins/all-in-one-seo-pack/">All in One SEO Pack</a> plugin. This <a href="http://sixrevisions.com/wordpress/10-wordpress-plugins-guaranteed-to-save-you-time/" title="10 WordPress Plugins Guaranteed to Save You Time">WordPress plugin</a> will automatically set up your <code>&lt;title&gt;</code> tags, making them more SEO-friendly. You also have the ability to manually specify the title of each post.</p>
<p><img src="http://cdn.sixrevisions.com/0093-04_wordpress_seo_plugin.jpg" width="550" height="284" /></p>
<p>The All in One SEO Pack WordPress plugin is one out of the <a href="http://sixrevisions.com/wordpress/6-critical-wordpress-plugins-you-should-have-installed/" title="6 Critical WordPress Plugins You Should Have Installed">six WordPress plugins that this site uses</a>.</p>
<h3>Meta Tags</h3>
<p>Meta description tags provide short explanations of what a web page is about. In search engine results pages, these descriptions appear as excerpts of the web page. It&#8217;s ideal to incorporate keywords you would like to rank on in your meta description tags. However, do so in a <a href="http://sixrevisions.com/content-strategy/user-friendly-seo/" title="User-Friendly SEO">human-friendly, non-spammy way.</a> The description should optimally be between 150-160 characters, the limit of many search engines before the description is trimmed at the end.</p>
<p>In WordPress, there&#8217;s no ideal way to automate the process of creating meta description tags. The best descriptions should be handwritten, and the previously mentioned All in One SEO pack will allow you to configure them for each post.</p>
<p>You can also add meta keyword tags on your posts for relevant keywords and key phrases, but it should be mentioned that Google <a href="http://googlewebmastercentral.blogspot.com/2009/09/google-does-not-use-keywords-meta-tag.html" target="_blank">no longer takes meta keyword tags into account</a> when determining search engine rankings.</p>
<p>With that being said, they won&#8217;t hurt, and <a href="http://sixrevisions.com/content-strategy/seo-for-bing-versus-google/" title="SEO for Bing Versus Google">there are other search engines out there besides Google</a> that might use meta keyword tags as a signal for ranking, so I still recommended adding keywords as a best practice.</p>
<p>You can also add meta keyword tags in your blog posts via the SEO All in One Pack.</p>
<h3>Use noindex Meta Tag for Duplicate Pages</h3>
<p>By default, WordPress has a few different ways to navigate to your content pages. Depending on the <a href="http://sixrevisions.com/resources/50-beautiful-free-wordpress-themes/">WordPress theme</a> you&#8217;re using, you might end up with<a href="http://www.google.com/support/webmasters/bin/answer.py?answer=66359"> duplicate content</a>, which is bad for SEO.</p>
<p>For example, let&#8217;s say you have a WordPress category with the following URL:</p>
<pre>http://example.com/category/<strong>my-category</strong>/</pre>
<p>This same category page can be viewed through:</p>
<pre>http://example.com/<strong>my-category</strong>/</pre>
<p>Not good. So how do you fix this?</p>
<p>By using the <code>noindex</code> HTML meta tag, you can inform search engines not to index certain URLs, which then reduces the chances of your site being penalized in search engine rankings for duplicate content. </p>
<p>The easiest way to do this is by using the All in One SEO pack plugin. In the plugin, you have the option to assign <code>noindex</code> for category, archive, and tag URLs.</p>
<p><img src="http://cdn.sixrevisions.com/0093-05_wordpress_seo_noindex.png" width="303" height="118" /></p>
<h3>Use HTML Headings Properly</h3>
<p>Using HTML heading tags (i.e. <code>&lt;h1&gt;</code>, <code>&lt;h2&gt;</code>, &#8230;, <code>&lt;h6&gt;</code>) to break up sections of lengthy blog posts and other content pages is a good way to make your content easier to read. It&#8217;s also regarded as a way to point out important keywords for web spiders as they may value these tags higher than other HTML text tags (such as <code>&lt;p&gt;</code> or <code>&lt;blockquote&gt;</code>).</p>
<p>What&#8217;s somewhat surprising is that, to this day, many WordPress themes still don&#8217;t pay particular attention to the content structure of a WordPress site&#8217;s content pages.</p>
<p>From an SEO perspective, <code>&lt;h1&gt;</code> is the most essential heading and should only be used once on a web page.</p>
<p>The <code>&lt;h2&gt;</code> tags are next in the hierarchy, and you can have several of them on the page. Below each <code>&lt;h2&gt;</code> you can have several <code>&lt;h3&gt;</code> tags, and below each <code>&lt;h3&gt;</code> tag, you can have  several <code>&lt;h4&gt;</code> tags, and so on. This is a semantic way of structuring your content, kind of like a book outline.</p>
<p>If you&#8217;re using a WordPress theme that you didn&#8217;t build yourself, look into the theme&#8217;s template files (such as <em>header.php,</em> <em>single.php,</em> <em>post.php,</em> <em>home.php,</em> and <em>page.php</em>) to ensure that built-in HTML markup follows good content structuring. If you did build the theme, double-check to make sure that you&#8217;re using good content structures.</p>
<h3>Use an XML Sitemap</h3>
<p>An <a href="http://www.sitemaps.org/">XML sitemap</a> is a standard protocol used to create an index of a website&#8217;s pages to help search engines find pages to crawl and to give them a better understanding of the website&#8217;s structure.</p>
<p>XML sitemaps are easy to create manually, but if you update your site with new content often, it might not be a good idea because you&#8217;ll have to constantly update your XML sitemap.</p>
<p>Using the <a href="http://wordpress.org/extend/plugins/google-sitemap-generator/">Google XML Sitemaps</a> WordPress plugin will automatically generate an XML sitemap of your WordPress website for you. It will even notify Google, Yahoo, Bing, and other search engines that your XML sitemap has been updated.</p>
<p><img src="http://cdn.sixrevisions.com/0093-06_wordpress_seo_xmlsitemap.png" width="544" height="317" /></p>
<p><em>What are your own WordPress tips and tricks for SEO?</em></p>
<h3>References</h3>
<ol>
<li id="ref-01"><a href="http://en.wordpress.com/stats/">Stats</a> (en.wordpress.com)</li>
</ol>
<h3>Related Content</h3>
<ul>
<li><a href="http://sixrevisions.com/content-strategy/how-shady-web-design-sites-get-high-search-engine-results/">How Shady Web Design Sites Get High Search Engine Results</a></li>
<li><a href="http://sixrevisions.com/content-strategy/user-friendly-seo/">User-Friendly SEO</a></li>
<li><a href="http://sixrevisions.com/content-strategy/seo-tips-improve-web-design/">10 Excellent SEO Tips That Will Improve Your Web Design</a></li>
<li><em>Related categories</em>: <a href="http://sixrevisions.com/category/wordpress/">WordPress</a> and <a href="http://sixrevisions.com/category/content-strategy/">Content Strategy</a></li>
</ul>
<h3>About the Author</h3>
<p class="about-author"><img src="http://cdn.sixrevisions.com/authors/adam_heitzman_small.jpg" alt="" width="80" height="80" /><strong>Adam Heitzman</strong> is a web designer/developer with a strong background in SEO. He&#8217;s a Managing Partner at <a href="http://www.highervisibility.com/" target="_blank">HigherVisbility</a>, a Memphis-based <a href="http://www.highervisibility.com/" target="_blank">internet marketing agency</a> that offers a full range of marketing services ranging from SEO, Pay Per Click Marketing, Web Design and Development, and Social Media Marketing. Connect with HigherVisibility on <a href="http://www.facebook.com/highervisibility" target="_blank">Facebook</a> and <a href="http://twitter.com/highervis" target="_blank">Twitter</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://sixrevisions.com/wordpress/fine-tuning-wordpress-seo/feed/</wfw:commentRss>
		<slash:comments>48</slash:comments>
		</item>
		<item>
		<title>10 Techniques for Customizing the WordPress Admin Panel</title>
		<link>http://sixrevisions.com/wordpress/10-techniques-for-customizing-the-wordpress-admin-panel/</link>
		<comments>http://sixrevisions.com/wordpress/10-techniques-for-customizing-the-wordpress-admin-panel/#comments</comments>
		<pubDate>Fri, 01 Apr 2011 12:30:10 +0000</pubDate>
		<dc:creator>Jacob Gube</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://sixrevisions.com/?p=5204</guid>
		<description><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5204&c=826594187' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5204&c=826594187' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br />A while back, I wrote a guide on how to improve the WordPress Admin Panel as an exploration of how we can customize the user interface of WordPress for end-users. In this post, I&#8217;ll take you even further with some awesome tricks, techniques and snippets from my website, WP-Snippets. In the previous post, we removed [...]]]></description>
			<content:encoded><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5204&c=1650920861' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=5204&c=1650920861' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br /><p><a href="http://sixrevisions.com/wordpress/10-techniques-for-customizing-the-wordpress-admin-panel/"><img src="http://cdn.sixrevisions.com/0085-01_customize_adminarea_wordpress_thumbnail.png" width="550" height="200" alt="10 Techniques for Customizing the WordPress Admin Panel" /></a></p>
<p>A while back, I wrote a guide on <a href="http://sixrevisions.com/wordpress/how-to-customize-the-wordpress-admin-area/">how to improve the WordPress Admin Panel</a> as an exploration of how we can customize the user interface of <a href="http://sixrevisions.com/category/wordpress/" title="WordPress category on Six Revisions">WordPress</a> for end-users. In this post, I&#8217;ll take you even further with some awesome tricks, techniques and snippets from my website, <a href="http://twitter.com/filipstefansson" target="_blank">WP-Snippets</a>.</p>
<p>In the previous post, we removed a lot of clutter and things that we didn&#8217;t need. Now we&#8217;ll focus on things that happen behind the scene that can enhance the user experience.</p>
<p><span id="more-5204"></span></p>
<h3>Before You Get Started</h3>
<p>If you don&#8217;t know what a <strong>filter</strong> or <strong>hook</strong> is, make sure to look at <a href="http://sixrevisions.com/wordpress/how-to-customize-the-wordpress-admin-area/http:/sixrevisions.com/wordpress/how-to-customize-the-wordpress-admin-area/">my previous post</a> to learn about them. Alternatively, you can  visit the WordPress Codex documentation on <a href="http://codex.wordpress.org/Plugin_API/Filter_Reference" target="_blank">filters</a> and <a href="http://codex.wordpress.org/Plugin_API/Hooks" target="_blank">hooks</a>.</p>
<p>Most of the code we&#8217;ll cover will go in <em>functions.php</em>, so you have to create one in your theme folder if you don&#8217;t have one. This is a file that WordPress automatically checks before your template is loaded, so all the code in it will be executed.</p>
<p>Some of the code we&#8217;ll cover will be placed in <em>wp-config.php</em>, which is found in the root folder of your WordPress installation.</p>
<p>Let&#8217;s get started!</p>
<h3>1. Remove the Admin Bar</h3>
<p>WordPress 3.1 introduced a new Twitter-like admin menu bar.</p>
<p><img src="http://cdn.sixrevisions.com/0085-02_admin_bar.jpg" width="545" height="103" /></p>
<p>If you don&#8217;t like it, you can disable it by putting the following in <em>functions.php:</em></p>
<pre>add_filter( 'show_admin_bar', '__return_false' );</pre>
<h3>2. Specify the Auto-save Interval</h3>
<p>WordPress has an auto-save feature for when you are writing a new post or a page so that in case your web browser crashes or your computer shuts down unexpectedly, you don&#8217;t lose all of your work.</p>
<p><img src="http://cdn.sixrevisions.com/0085-03_autosave_interval.jpg" width="295" height="207" /></p>
<p>It&#8217;s a good feature, but personally, I think it auto-saves way too often, which might slightly affect a website&#8217;s performance. Alternatively, you might be thinking WordPress doesn&#8217;t auto-save frequently enough.</p>
<p>Whatever the case may be, there&#8217;s a way to specify the interval in which WordPress performs auto-saves.</p>
<p>To specify the interval that WordPress should auto-save, you just have to put a single line of code in <em>wp-config.php</em>:</p>
<pre>define('AUTOSAVE_INTERVAL', 600); <strong>// 60 * 10, auto-saves every 10 minutes</strong></pre>
<p>Note that the time unit is seconds. Above, it will save every 600 seconds (or every 10 minutes).</p>
<h3>3. Disable Auto-save</h3>
<p>Some people may prefer to disable the auto-save feature completely. This is done in <em>functions.php</em> by adding this action:</p>
<pre>function no_autosave() {
  wp_deregister_script('autosave');
}

add_action( 'wp_print_scripts', 'no_autosave' );</pre>
<h3>4. Reduce or Disable Revisions</h3>
<p>Post revisions are another great feature in WordPress. It saves different instances of your post so that you can revert to previous versions. However, this can easily get out of hand since WordPress doesn&#8217;t have any limit on how many revisions is allowed.</p>
<p><img src="http://cdn.sixrevisions.com/0085-04_limit_revisions.jpg" width="246" height="251" /></p>
<p>If WordPress creates revisions frequently, it can make it difficult to find the version you need. Most importantly, many versions of a post can occupy more space in your WordPress database than you need it to.</p>
<p>To limit the amount of post revisions (or to disable post revisions altogether), add the following to your <em>wp-config.php</em> file:</p>
<pre>define('WP_POST_REVISIONS', 5); <strong>// Maximum 5 revisions per post</strong>
define('WP_POST_REVISIONS', false); <strong>// Disable revisions</strong></pre>
<h3>5. Empty Trash Automatically</h3>
<p>The Trash feature was introduced in WordPress 2.7, and since then, WordPress content that you delete gets staged there. It&#8217;s great for fault-tolerance in case you accidentally delete something you didn&#8217;t mean to. The feature works similarly to the Recycling Bin feature on Windows or the Trash feature in Mac OS.</p>
<p><img src="http://cdn.sixrevisions.com/0085-05_trash.png" width="459" height="52" /></p>
<p>Once you empty the Trash in WordPress, it is permanently deleted from the database. It is therefore important to empty your Trash regularly to keep your database in clean, tip-top shape.</p>
<p>Though the Trash feature is a welcome addition to WordPress, just like in real life, taking out the trash is a burden, and it would be much more convenient if someone else did it for you. Luckily, WordPress doesn&#8217;t mind doing the heavy lifting for you.</p>
<p>Just add this line to <em>wp-config.php</em> and you&#8217;re done:</p>
<pre>define('EMPTY_TRASH_DAYS', 5 ); <strong>// Empty trash every 5 days</strong></pre>
<h3>6. Remove the Visual Editor</h3>
<p>If you are a web developer like me, you are probably scared of the visual editor in WordPress. Enter it, and it may mess up your nice HTML markup, especially when you&#8217;re posting code.</p>
<p><img src="http://cdn.sixrevisions.com/0085-06_disable_visual_editor.jpg" width="550" height="76" /></p>
<p>I always disable the Visual Editor for my own websites, just to make sure I don&#8217;t accidentally switch over to it.</p>
<p>It&#8217;s possible to disable it conditionally for each WordPress user by going to Users &gt; Your Profile. However, if you want to remove it completely, you can add the following filter:</p>
<pre>add_filter('user_can_richedit' , create_function('' , 'return false;') , 50);</pre>
<h3>7. Edit the Help Dropdown Text</h3>
<p>If you take a look at the top right of the WordPress Admin panels you&#8217;ll see a button that says &quot;Help.&quot; When you click it, Help text slides down.</p>
<p><img src="http://cdn.sixrevisions.com/0085-07_help.jpg" width="550" height="148" /></p>
<p>This is a great place to add your own custom Help text for a client. You can even customize it for different Admin panels. For example, you can add a different Help text for the <em>Add New Post</em> panel and another one for the <em>Comments</em> panel.</p>
<p>Here&#8217;s how you go about it:</p>
<pre>add_action('load-page-new.php','custom_help_page');
add_action('load-page.php','custom_help_page');
function custom_help_page() {
  add_filter('contextual_help','custom_page_help');
}
function custom_page_help($help) {
  // echo $help; <strong>// Uncomment if you just want to append your custom Help text to the default Help text</strong>
  echo &quot;&lt;h5&gt;Custom Help text&lt;/h5&gt;&quot;;
  echo &quot;&lt;p&gt; HTML goes here.&lt;/p&gt;&quot;;
}</pre>
<p>To find what file you should add the action to, just check the address bar in your browser and add the <em>load-</em> prefix right before the file name. For example, if you wanted to add the custom Help text to the <em>Add New Post</em> panel, which has a file name of <em>post-new.php</em>, then you would use <em>load-post-new.php</em> as the parameter of the <code>add_action</code> function shown above.</p>
<h3>8. Change the Contact Info Form</h3>
<p>In the User settings, there is a web form called Contact Info. It has input fields for the user&#8217;s AIM account, Yahoo IM account, and so on. </p>
<p>But how about Twitter? What about Facebook? Out of the box, the Contact Info panel doesn&#8217;t have these input fields.</p>
<p>If you have multiple users on your WordPress blog, you might want to add new fields and remove old ones. </p>
<p><img src="http://cdn.sixrevisions.com/0085-08_contact_info.jpg" width="410" height="148" /></p>
<p>This is how you do it:</p>
<pre>function new_contactmethods( $contactmethods ) {
  $contactmethods['twitter'] = 'Twitter'; <strong>// Add Twitter</strong>
  $contactmethods['facebook'] = 'Facebook'; <strong>// Add Facebook</strong>
  unset($contactmethods['yim']); <strong>// Remove Yahoo IM</strong>
  unset($contactmethods['aim']); <strong>// Remove AIM</strong>
  unset($contactmethods['jabber']); <strong>// Remove Jabber</strong>

return $contactmethods;
}

add_filter('user_contactmethods','new_contactmethods',10,1);</pre>
<p>WordPress automatically does all the database work for you.</p>
<h3>9. Change Role Capabilities</h3>
<p>This is a handy snippet if you have multiple contributors on your WordPress website. The following code snippet allows you to change what the different WordPress user roles can and can&#8217;t do.</p>
<pre>$edit_contributor = get_role('contributor'); <strong>// Get the user role</strong>
$edit_contributor-&gt;add_cap('upload_files'); <strong>// Contributor can now upload media</strong>
$edit_contributor-&gt;remove_cap('delete_posts'); <strong>// Contributor can no longer delete posts</strong></pre>
<p>A full list of roles and capabilities you can add or remove can be found <a href="http://codex.wordpress.org/Roles_and_Capabilities" target="_blank" title="Roles and Capabilities - WordPress Codex">here</a>. </p>
<p><strong>Important:</strong> The capabilities are written to the database, so if you want to give back a capability to a user role, you have to use the <code>add_cap</code> function to reverse the removal (and, vice versa, use <code>remove_cap</code> if you want to remove a capability you added in this fashion).</p>
<h3>10. Check User Capabilities</h3>
<p>This is extremely useful when you want to allow certain user roles to see certain things depending on their capabilities. This is done with <a href="http://codex.wordpress.org/Conditional_Tags" target="_blank">conditional tags</a>.</p>
<pre>if( !is_admin() ) {
  add_filter( 'pre_site_transient_update_core', create_function( '$a', &quot;return null;&quot; ) );
}</pre>
<p>Using <code>is_admin()</code> is one way to do it, but there is also a function called <code>current_user_can() </code>that lets you specify what capability the user needs to possess in order to see whatever it is you&#8217;re conditionally hiding.</p>
<pre>if( current_user_can('edit_pages') ) {
  <strong>// True if user can edit pages</strong>
}

if( !current_user_can('delete_private_posts') ) {
  <strong>// True if user can't delete private posts</strong>
}
if( current_user_can('activate_plugins') ) {
  <strong>// True if user can activate plugins</strong>
}</pre>
<h3>Related Content</h3>
<ul>
<li><a href="http://sixrevisions.com/wordpress/beginning-wordpress-development-a-look-at-common-functions/">Beginning WordPress Development: A Look at Common Functions</a></li>
<li><a href="http://sixrevisions.com/wordpress/taxonomy/">A Guide to WordPress Custom Taxonomy</a></li>
<li><a href="http://sixrevisions.com/wordpress/custom-fields-search/">Enhancing WordPress Custom Fields with Search Filtering</a></li>
<li><em>Related categories</em>: <a href="http://sixrevisions.com/category/wordpress/">WordPress</a> and <a href="http://sixrevisions.com/category/web-development/">Web Development</a></li>
</ul>
<h3>About the Author</h3>
<p class="about-author"><img src="http://images.sixrevisions.com/authors/filip_stefansson_small.jpg" alt="" width="80" height="80" /><strong>Filip Stefansson</strong> is a 20-year-old web developer from Sweden who is a WordPress fanatic. He runs <a href="http://wp-snippets.com">WP-Snippets</a> and <a href="http://pixby.se">Pixby</a>. You can connect with Filip via <a href="http://twitter.com/filipstefansson/">Twitter</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://sixrevisions.com/wordpress/10-techniques-for-customizing-the-wordpress-admin-panel/feed/</wfw:commentRss>
		<slash:comments>42</slash:comments>
		</item>
		<item>
		<title>8 Excellent WordPress SEO Plugins</title>
		<link>http://sixrevisions.com/wordpress/seo-plugins/</link>
		<comments>http://sixrevisions.com/wordpress/seo-plugins/#comments</comments>
		<pubDate>Thu, 17 Feb 2011 13:00:02 +0000</pubDate>
		<dc:creator>Jacob Gube</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://sixrevisions.com/?p=4927</guid>
		<description><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4927&c=338815444' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4927&c=338815444' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br />WordPress is one the most popular tools for publishing content on the web. Everything from e-commerce websites to blogs can be developed using WordPress. Additionally, the WordPress community has built up a huge offering of free themes and plugins to make it easy for newcomers to get content published on the web quickly and easily. [...]]]></description>
			<content:encoded><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4927&c=1934111651' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4927&c=1934111651' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br /><p><a href="http://sixrevisions.com/wordpress/seo-plugins/"><img src="http://cdn.sixrevisions.com/0037-01_wordpress_seo_plugins_thumbnail.jpg" width="550" height="200" alt="8 Excellent WordPress SEO Plugins" /></a></p>
<p>WordPress is one the most popular tools for publishing content on the web. Everything from <a href="http://sixrevisions.com/wordpress/top-5-excellent-e-commerce-plugins-for-wordpress/" title="Top 5 Excellent E-Commerce Plugins for WordPress - sixrevisions.com">e-commerce websites</a> to <a href="http://sixrevisions.com/wordpress/beautiful_wordpress_designs/" title="45 Beautiful and Creative (WordPress) Designs - sixrevisions.com">blogs</a> can be developed using WordPress. Additionally, the WordPress community has built up a huge offering of <a href="http://sixrevisions.com/resources/50-beautiful-free-wordpress-themes/" title="50 Beautiful Free WordPress Themes - sixrevisions.com">free themes</a> and plugins to make it easy for newcomers to get content published on the web quickly and easily.</p>
<p><span id="more-4927"></span></p>
<p>However, just posting content on the web isn&#8217;t enough for many; attracting people to your site is <a href="http://www.resourcenation.com/blog/seo-part-science-part-art-part-what/31537/">part science, part art</a> &#8212; and many WordPress plugins help you do just that. This is a listing of top-notch WordPress plugins for SEO to <a href="http://sixrevisions.com/wordpress/optimizing-wordpress-for-search-engines/">improve your WordPress site&#8217;s search engine rankings</a>.</p>
<h3>1. <a href="http://wordpress.org/extend/plugins/seo-rank-reporter/">SEO Rank Reporter</a></h3>
<p><img src="http://cdn.sixrevisions.com/0037-07_seo_reporter_wordpress_plugin.png" width="550" height="213" alt="SEO Rank Reporter" /></p>
<p>This WordPress SEO plugin allows you to track certain keywords in your site, and then issues you a report every 3 days (with all sorts of pretty graphs to boot). The plugin will also notify you via email whenever certain keywords experience major changes in search engine ranking.</p>
<h3>2. <a href="http://wordpress.org/extend/plugins/all-in-one-seo-pack/">All in One SEO Pack</a></h3>
<p><img src="http://cdn.sixrevisions.com/0037-02_all_in_one_seo_wordpress_plugin.jpg" width="550" height="207" alt="All in One SEO Pack" /></p>
<p>Any basic research on SEO plugins for WordPress will lead you to <em>All in One SEO Pack</em>. It is the most popular solution for your WordPress site&#8217;s search engine optimization. This plugin automatically optimizes your WordPress site for search engines by generating meta tags and helping you <a href="http://sixrevisions.com/content-strategy/5-common-seo-mistakes-with-web-page-titles/" title="5 Common SEO Mistakes with Web Page Titles - sixrevisions.com">optimize web page titles</a>. Advanced users are given the ability to customize post titles, descriptions, URL structures and tags for each post.</p>
<h3>3. <a href="http://wordpress.org/extend/plugins/seo-ultimate/">SEO Ultimate</a></h3>
<p><img src="http://cdn.sixrevisions.com/0037-06_seo_ultimate.png" width="532" height="262" alt="SEO Ultimate" /></p>
<p><em>SEO Ultimate</em> is a suite of tools for, well, <em>ultimate</em> SEO. It has a feature called Canonicalizer, which extends WordPress&#8217;s native canonical features to ensure that web spiders are pointed to the primary post in the case of web pages with the same content, but different URLs. It has a built-in robot.txt editor (one of the <a href="http://sixrevisions.com/web-standards/5-web-files-that-will-improve-your-website/">five web files that will enhance your site</a>) that will allow you to easily set up this file for optimal search engine indexing. It works well with All in One SEO Pack, allowing you to import meta-data from it if you wanted to switch to SEO Ultimate.</p>
<h3>4. <a href="http://wordpress.org/extend/plugins/seo-content-control/">SEO Content Control</a></h3>
<p><img src="http://cdn.sixrevisions.com/0037-08_seo_content_wordpress_plugin.png" width="550" height="311" alt="SEO Content Control" /></p>
<p>This nifty plugin helps you identify weak content in your site. For example, many WordPress owners forget to include descriptions of their categories, which is a potential point of improvement for enhancing your search engine rankings. <em>SEO Content Control</em> helps you easily identify these potentially troublesome areas.</p>
<h3>5. <a href="http://wordpress.org/extend/plugins/seo-image/">SEO Friendly Image</a></h3>
<p><img src="http://cdn.sixrevisions.com/0037-03_seo_friendly_wordpress_plugin.png" width="550" height="384" alt="SEO Friendly Image" /></p>
<p>Optimizing images for search engines is often neglected; but when done right, you increase their semantic value, accessibility, and search engine indexability, especially for image searches. This WordPress SEO plugin automatically updates your images with <code>alt</code> and <code>title</code> attributes.</p>
<h3>6. <a href="http://wordpress.org/extend/plugins/seo-automatic-links/">SEO Smart Links</a></h3>
<p><img src="http://cdn.sixrevisions.com/0037-04_seo_links_wordpress_plugin.png" width="458" height="328" alt="SEO Smart Links" /></p>
<p><em>SEO Smart Links</em> is a WordPress SEO plugin that automatically links keywords and phrases in your blog posts based on previous pages and posts. SEO Smart Links gives you the ability to set up your own unique keywords and sets of matching URLs. It also allows you to set <code>nofollow</code> attributes and open links in new browser windows or browser tabs. A very convenient way to save time, learn a bit about SEO best practices and interlink blog posts.</p>
<h3>7. <a href="http://wordpress.org/extend/plugins/google-sitemap-generator/">Google XML Sitemaps</a></h3>
<p><img src="http://cdn.sixrevisions.com/0037-05_googlesitemaps_seo_wordpress_plugin.jpg" width="550" height="377" alt="Google XML Sitemaps" /></p>
<p>This WordPress plugin is able to generate an XML sitemap that will assist search engine spiders in crawling and indexing your WordPress site. XML Sitemaps reveals the structure of your site&#8217;s content in a transparent way for search engines<em>. Google XML Sitemaps</em> also includes support for Bing, Yahoo!, Ask.com, and MSN, notifying them every time you create a post.</p>
<h3>8. <a href="http://wordpress.org/extend/plugins/platinum-seo-pack/">Platinum SEO Pack</a></h3>
<p><img src="http://cdn.sixrevisions.com/0037-09_platinum_seo_wordpress_plugin.png" width="500" height="221" alt="Platinum SEO Pack" /></p>
<p>This SEO plugin for WordPress is loaded with plenty of features, including automatically generating meta tags, helping you optimize page and post titles for search engines, and aiding you in avoiding duplicate content (one of the ways to <a href="http://sixrevisions.com/web_design/improve-seo-website-design/" title="9 Ways To Improve the SEO of Every Website You Design - sixrevisions.com">improve SEO of sites you design</a>).</p>
<h3>Conclusion</h3>
<p>These WordPress plugins will give your WordPress site a complete SEO overhaul. Installing them and getting to understand each plugin&#8217;s inner workings may take some time, but it is worth it to know how each plugin can benefit your site. When used correctly, your content will be more visible, potentially attracting additional traffic consisting of your target audience.</p>
<h3>Related Content</h3>
<ul>
<li><a href="http://sixrevisions.com/web-development/10-seo-tips-to-remember-when-building-your-site/">10 SEO Tips to Remember When Building Your Site</a></li>
<li><a href="http://sixrevisions.com/tools/tools_monitoring_website_popularity/">15 Tools for Monitoring a Website’s Popularity</a></li>
<li><a href="http://sixrevisions.com/tutorials/web-development-tutorials/using-xampp-for-local-wordpress-theme-development/">Using XAMPP for Local WordPress Theme Development</a></li>
<li><em>Related categories</em>: <a href="http://sixrevisions.com/category/wordpress/">WordPress</a> and <a href="http://sixrevisions.com/category/website-management/">Website Management</a></li>
</ul>
<h3>About the Author</h3>
<p class="about-author"><img src="http://cdn.sixrevisions.com/authors/matt_krautstrunk_small.jpg" alt="" width="80" height="80" /><strong>Matt Krautstrunk</strong> is an expert writer on <a href="http://www.resourcenation.com/business/document-management-software?version=C">document management software </a>based in San  Diego, California. He writes extensively for an online resource that provides expert advice on purchasing and outsourcing decisions for small business owners and entrepreneurs such as <a href="http://www.business.com/directory/accounting/payroll_accounting/payroll_services/">payroll services </a> at <a href="http://www.resourcenation.com/">Resource Nation</a>. You can follow him on Twitter @<a href="http://twitter.com/Mattbill">Mattbill</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://sixrevisions.com/wordpress/seo-plugins/feed/</wfw:commentRss>
		<slash:comments>114</slash:comments>
		</item>
		<item>
		<title>Enhancing WordPress Custom Fields with Search Filtering</title>
		<link>http://sixrevisions.com/wordpress/custom-fields-search/</link>
		<comments>http://sixrevisions.com/wordpress/custom-fields-search/#comments</comments>
		<pubDate>Tue, 15 Feb 2011 16:50:34 +0000</pubDate>
		<dc:creator>Jacob Gube</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://sixrevisions.com/?p=4912</guid>
		<description><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4912&c=808143228' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4912&c=808143228' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br />Custom fields are an excellent feature in WordPress. They allow you to store any extra information (meta-data) about a post that you may want. When I first started using WordPress as a content management system, I shied away from them, as I thought they would be difficult to use for end-users (i.e. the client), but [...]]]></description>
			<content:encoded><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4912&c=1912907782' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4912&c=1912907782' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br /><p><a href="http://sixrevisions.com/wordpress/custom-fields-search/"><img src="http://cdn.sixrevisions.com/0034-01_custom_search_wordpress_thumbnail.jpg" width="550" height="200" alt="Enhancing WordPress Custom Fields with Search Filtering" /></a></p>
<p><a href="http://codex.wordpress.org/Custom_Fields">Custom fields</a> are an excellent feature in <a href="http://sixrevisions.com/category/wordpress/" title="WordPress category on Six Revisions - sixrevisions.com">WordPress</a>. They allow you to store any extra information (meta-data) about a post that you may want.</p>
<p>When I first started using WordPress as a <a href="http://sixrevisions.com/web-development/how-to-evaluate-what-cms-to-use/">content management system</a>, I shied away from them, as I thought they would be difficult to use for end-users (i.e. the client), but as I learned more about <a href="http://sixrevisions.com/wordpress/how-to-customize-the-wordpress-admin-area/" title="How to Customize the WordPress Admin Area - sixrevisions.com">customizing the administration panels of WordPress</a>, I began to realize what a powerful addition to a WordPress site they could be.</p>
<p><span id="more-4912"></span></p>
<p>However, adding the ability to search your posts by custom field is a little tricky; the native search feature of WordPress doesn&#8217;t search custom field values.</p>
<p>In this guide, I&#8217;ll show you how to work with custom fields and how to make them even more powerful by adding the ability to display and filter them.</p>
<p>What we are going to do is create a very simple events listing page for a company that organizes <a href="http://www.uk-jelly.org.uk/what-is-jelly/">Jelly</a> co-working events, located in the UK. We will make the events listing page sortable by county. Each post will be an event with a title, description and a custom field for the area the event based in. (Alternatively, instead of using WordPress&#8217;s native <em>Post</em> post type, you can <a href="http://sixrevisions.com/wordpress/wordpress-custom-post-types-guide/" title="WordPress Custom Post Types Guide - sixrevisions.com">create a custom post type for events</a>).</p>
<p>This guide assumes that you have ready-access to WordPress. If you would like to follow along step-by-step, you are encouraged to <a href="http://sixrevisions.com/web-development/install-wordpress-on-your-computer-using-wampserver/" title="Install WordPress on Your Computer Using WampServer - sixrevisions.com">install WordPress on your computer</a> instead of working with a live/production WordPress instance.</p>
<h3>Setting Up the Custom Field in WordPress Admin</h3>
<p>The first thing to do is set up the meta-data for each event. There is a strong argument to be made here for using the new custom post types feature that was introduced in <a href="http://sixrevisions.com/wordpress/wordpress-3-0-guide/" title="WordPress 3.0: Ultimate Guide to New Features - sixrevisions.com">WordPress 3.0</a>, but to keep it simple, we will use the native <em><a href="http://codex.wordpress.org/Posts_Posts_SubPanel#Posts_.E2.86.92_Posts">Post</a></em> post type in WordPress, and to indicate that they are events instead of regular posts, we will place them within a category called &quot;Find a Jelly&quot;.</p>
<p>Start by adding each event as a post. Depending on your <a href="http://sixrevisions.com/resources/50-beautiful-free-wordpress-themes/" title="50 Beautiful Free WordPress Themes - sixrevisions.com">WordPress theme</a>, you could also add custom thumbnails and a variety of additional information.</p>
<p>Once you have added the standard data and selected the correct category, scroll down to the <em>Add New Custom Field</em> section near the bottom of the <em>Add New Post</em> panel.</p>
<p><img src="http://cdn.sixrevisions.com/0034-02_custom_fields_addpost.jpg" width="550" height="131" /></p>
<p>Click on <em>Enter New</em>, give your custom field a relevant name (Being in the UK, this example will use counties as the custom field key, although it could easily use states or regions). This will form the meta key in the database, so make sure its something simple (preferably one word) so that code-authoring isn&#8217;t cumbersome.</p>
<p>Next, add a custom field value for the counties custom field (the name of the county where the Jelly is located). In my case, the values could be <em>Shropshire</em>,  <em>Bedfordshire</em>, <em>Northamptonshire</em>, and so on.</p>
<p>Click the <em>Add Custom Field</em> button to add the county meta-data, and then update your post.</p>
<p>From here on out, for each additional event you add, you will see the counties custom fields appear in the dropdown menu for custom fields; you don&#8217;t have to keep adding it in.</p>
<p><img src="http://cdn.sixrevisions.com/0034-03_custom_fields_new.jpg" width="550" height="270" /></p>
<p>Once you have set up all of your events listings with their country custom field values, it&#8217;s time to start on the search filtering function.</p>
<h3>Creating the Events Listing Page Template</h3>
<p>Open <em>page.php</em> in your theme folder and save it as a new file. In this case, I&#8217;ve called the new page template as <em>find-jelly.php</em>.</p>
<p>Give the file a template name by adding this line to the top of the page:</p>
<pre>Template Name: Find a Jelly
</pre>
<p>Now, when you create a new page for your directory, this page will appear in the list of available templates.</p>
<p><img src="http://cdn.sixrevisions.com/0034-04_custom_fields_newpage.jpg" width="550" height="101" /></p>
<h3>Creating the County  Filtering Dropdown Menu</h3>
<p>To create the web form that will allow users to filter the results, add this code to the <em>find-jelly.php</em> page template we created earlier, wherever you would like the dropdown input field to be displayed in the events listing page:</p>
<pre>&lt;form name=&quot;search&quot; action=&quot;&quot; method=&quot;get&quot;&gt;
  &lt;select name=&quot;county&quot;&gt;
  &lt;?php
  $metakey = 'county';
  $counties = $wpdb-&gt;get_col($wpdb-&gt;prepare(&quot;SELECT DISTINCT meta_value FROM $wpdb-&gt;postmeta WHERE meta_key = %s ORDER BY meta_value ASC&quot;, $metakey) );
  if ($counties) {
    foreach ($counties as $county) {
      echo &quot;&lt;option value=\&quot;&quot; . $county . &quot;\&quot;&gt;&quot; . $county . &quot;&lt;/option&gt;&quot;;
    }
  }
  ?&gt;
  &lt;/select&gt;
  &lt;input type=&quot;submit&quot; value=&quot;search&quot; /&gt;
&lt;/form&gt;
</pre>
<p>Let me explain what&#8217;s going on in the code block above.</p>
<h4>The Markup</h4>
<p>First of all, we have a basic HTML form with the <code>action</code> attribute left blank as we want the form to return to the same page when submitted. We set the <code>method</code> to <code>get</code> so that we can see the search criteria in the URL in the same way as the standard WordPress search. Using <code>get</code> is a nice touch that allows the user to share the search results link, as well as allowing us to use our <a href="http://sixrevisions.com/usabilityaccessibility/10-promising-free-web-analytics-tools/" title="10 Promising Free Web Analytics Tools - sixrevisions.com">analytics software</a> (such as Google Analytics) to study popular event searches.</p>
<p>The <code>&lt;form&gt;</code> element contains a dropdown menu (<code>&lt;select&gt;</code>), with the <code>&lt;option&gt;</code> elements being the counties.</p>
<p>The submit button (<code>&lt;input type=&quot;submit&quot;&gt;</code>) allows for form submission; though, with a bit of JavaScript, you can submit the form when the user picks the option, saving them the user action of having to click on a submit button.</p>
<h4>Populating the Dropdown Menu</h4>
<p>The next part of our code is the tricky bit; we need to populate the <code>&lt;select&gt;</code> element with <code>&lt;option&gt;</code> elements of all the custom field values. To do so, we loop through all of the values in the database for the county custom field key; but we only want display unique values rather than every instance that they are attached to a post.</p>
<p>To do all of that, we use <code>$wpdb-&gt;get_col()</code>. <code>$wpdb</code> is a WordPress PHP class that allows us to construct our own SQL queries and do other database-related tasks. The <code>get_col()</code> method in <code>$wpdb</code> is used to select a specific column within our WordPress database.</p>
<p>First, we create a variable called string variable called <code>$metakey</code> that is assigned the name of our custom field (which is named <code>county</code>); this is optional, and just makes our code a little bit more readable.</p>
<p>Then using <code>$wpdb-&gt;get_col()</code>, we feed our SQL query as a prepared statement using WordPress&#8217;s handy <code>$wpdb-&gt;prepare()</code> method.</p>
<p>This is the SQL query from above (which has been rewritten and formatted slightly for discussion):</p>
<pre>SELECT DISTINCT meta_value
FROM $wpdb-&gt;postmeta
WHERE meta_key = $metakey
ORDER BY meta_value ASC</pre>
<p>This SQL query selects all unique records in the <code>meta_value</code> column of the WordPress <code>postmeta</code>, wherever <code>meta_key</code> is equal to <code>&quot;county&quot;</code>; it returns the results alphabetically.</p>
<p>Each result is then printed as the <code>value</code> attribute of each <code>&lt;option&gt;</code> element.</p>
<p>Once you have added the form, you should see something like the following image on your page; I have  styled this page, as well as added a Google Maps widget &#8212; we won&#8217;t cover that here.</p>
<p><img src="http://cdn.sixrevisions.com/0034-05_newpage.jpg" width="550" height="244" /></p>
<h3>Displaying the Search Results</h3>
<p>OK, so that&#8217;s the actual search filter set up; now we need some results. To do this, we are going to add the following code to the <em>find-jelly.php</em> template after the code for the web form:</p>
<pre>&lt;?php
$counties = $_GET['county'];
if ($counties) {
  $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;

  $args=array(
    'cat'=&gt;19,
    'meta_value' =&gt; $counties,
    'paged'=&gt;$paged,
  );

  query_posts($args);
} else {
  query_posts('cat=19&amp;posts_per_page=4');
}

if ($counties) { ?&gt;
  &lt;h3&gt;Your Search For &lt;?php echo $counties; ?&gt;&lt;/h3&gt;
  &lt;?php } else { ?&gt;
  &lt;h3&gt;Recently Added&lt;/h3&gt;
  &lt;?php }

if (have_posts()) :  while (have_posts()) : the_post();

$event_county = get_post_meta($post-&gt;ID, 'county', true); ?&gt;
&lt;div class=&quot;entry&quot;&gt;
  &lt;h2&gt;&lt;a href=”&lt;/php the_permalink(); ?&gt;” title=”&lt;?php the_title_attribute(); ?&gt;”&gt;
  &lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;
  &lt;?php the_excerpt(); ?&gt;
  &lt;?php echo $event_county; ?&gt;
  &lt;a href=”&lt;/php the_permalink(); ?&gt;” title=”&lt;?php the_title_attribute(); ?&gt;”&gt;  Read More&lt;/a&gt;
&lt;/div&gt;
&lt;?php endwhile;  ?&gt;
&lt;?php else : ?&gt;
&lt;p&gt;Sorry no results were found&lt;/p&gt;
&lt;?php endif; ?&gt;

&lt;?php wp_reset_query(); ?&gt;
</pre>
<p>It looks like there is a lot going on there, simply because of the shear volume of code versus the first code block, but there isn&#8217;t, really;  if you have worked with <a href="http://sixrevisions.com/wordpress/beginning-wordpress-development-a-look-at-common-functions/" title="Beginning WordPress Development: A Look at Common Functions - sixrevisions.com">WordPress theme development</a> before, the above will look pretty straightforward to you. Let&#8217;s break it down into its major components.</p>
<p>To start, we set up a variable to collect any form data that has been added to the page URL by looking into the <code>$_GET[]</code> array.</p>
<pre>$counties = $_GET['county'];
</pre>
<p>Then we check to see if any data has been passed; if it has, we run a simple WordPress query:</p>
<pre>
if ($counties) {
  $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;

  $args=array(
      'cat'=&gt;19,
      'meta_value' =&gt; $counties,
      'paged'=&gt;$paged,
  );

  query_posts($args);
}
</pre>
<p>The <code>$paged</code> variable is included so that the standard WordPress pagination can be used if there are a lot of results. I have included the <code>'cat'</code> parameter (19 is the category ID of my category, but yours may differ) to make sure only posts from the <em>Find a Jelly</em> category are displayed; this isn&#8217;t necessary, but is an extra measure for fault-tolerance in case your client mistakenly adds the custom field to other posts outside of the <em>Find a Jelly</em> category. The <code>meta_value</code> needs to match our search query.</p>
<p>If the search function hasn&#8217;t been used, we need the page to display something, so I&#8217;ve set it to add the four most recent entries.</p>
<pre>
else {
  query_posts('cat=19&amp;posts_per_page=4');
}</pre>
<p>Next, we display a title depending on whether a search has been used:</p>
<pre>if ($counties) { ?&gt;
  &lt;h3&gt;Your Search For &lt;?php echo $counties; ?&gt;&lt;/h3&gt;
  &lt;?php } else { ?&gt;
  &lt;h3&gt;Recently Added&lt;/h3&gt;
&lt;?php }
</pre>
<p>And finally, we add the standard WordPress loop to loop through all of the results depending on the query used above. The only additional functionality is that I&#8217;ve added in the following:</p>
<pre>$event_county = get_post_meta($post-&gt;ID, 'county', true); ?&gt;
</pre>
<p>The above line of code gets the custom field information inside the loop and displays the county as part of each listing.</p>
<p>Save your file and upload it to your server, and you should now be able to sort all of your posts within the correct category by the custom field &#8216;county&#8217;.</p>
<p>For a live example of this, check out the <a href="http://www.uk-jelly.org.uk/find-a-jelly/">Find a Jelly page</a> on the UK Jelly website. You will see that I&#8217;ve taken the custom fields quite a lot further by integrating Google Maps  with clickable markers listing all locations, as well as quite a lot of additional information about each Jelly.</p>
<h3>Related Content</h3>
<ul>
<li><a href="http://sixrevisions.com/wordpress/30-excellent-wordpress-video-tutorials/">30 Excellent WordPress Video Tutorials</a></li>
<li><a href="http://sixrevisions.com/tutorials/web-development-tutorials/using-xampp-for-local-wordpress-theme-development/">Using XAMPP for Local WordPress Theme Development</a></li>
<li><a href="http://sixrevisions.com/wordpress/top-5-excellent-e-commerce-plugins-for-wordpress/">Top 5 Excellent E-Commerce Plugins for WordPress</a></li>
<li><em>Related categories:</em> <a href="http://sixrevisions.com/category/wordpress/">WordPress</a> and <a href="http://sixrevisions.com/category/web-development/">Web Development</a></li>
</ul>
<h3>About the Author</h3>
<p class="about-author"><img src="http://cdn.sixrevisions.com/authors/kirsty_burgoine_small.jpg" alt="" width="80" height="80" /><strong>Kirsty Burgoine</strong> is a designer/web developer specializing in WordPress. She runs her own <a href="http://www.kirstyburgoine.co.uk/">Shropshire Web Design</a> Company in the UK, is the owner of <a href="http://www.imagine-shropshire.co.uk/">Imagine Shropshire</a> (online magazine for news events in the county), and helps organize <a href="http://www.shropgeek.co.uk/">Shropgeek</a>, A casual monthly meetup for like minded people. Follow her on Twitter as @<a href="http://www.twitter.com/KirstyBurgoine">kirstyburgoine</a>, @<a href="http://www.twitter.com/ShropGeek">Shropgeek</a> or @<a href="http://www.twitter.com/ImagineShrops">ImagineShrops</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://sixrevisions.com/wordpress/custom-fields-search/feed/</wfw:commentRss>
		<slash:comments>43</slash:comments>
		</item>
		<item>
		<title>Beginning WordPress Development: A Look at Common Functions</title>
		<link>http://sixrevisions.com/wordpress/beginning-wordpress-development-a-look-at-common-functions/</link>
		<comments>http://sixrevisions.com/wordpress/beginning-wordpress-development-a-look-at-common-functions/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 11:00:04 +0000</pubDate>
		<dc:creator>Jacob Gube</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://sixrevisions.com/?p=4411</guid>
		<description><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4411&c=881960719' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4411&c=881960719' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br />WordPress is a great blogging and CMS platform. It&#8217;s easy to use and customize, and there&#8217;s basically nothing you can&#8217;t do with it. If you haven&#8217;t used WordPress, give it a try by installing it on your own computer using a web server package like xampp or WampServer. You&#8217;ll need access to WordPress in order [...]]]></description>
			<content:encoded><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4411&c=899964160' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4411&c=899964160' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br /><p><a href="http://sixrevisions.com/wordpress/beginning-wordpress-development-a-look-at-common-functions/"><img src="http://images.sixrevisions.com/2010/11/13-01_wordpress_common_functions_ld_img.png" width="550" height="200" alt="Beginning WordPress Development: A Look at Common Functions" /></a></p>
<p><a href="http://sixrevisions.com/category/wordpress/" title="WordPress category on Six Revisions - sixrevisions.com">WordPress</a> is  a great blogging and <a href="http://sixrevisions.com/web-development/how-to-evaluate-what-cms-to-use/" title="How to Evaluate What CMS to Use - sixrevisions.com">CMS</a> platform.  It&#8217;s easy to use and customize, and there&#8217;s basically nothing you can&#8217;t do with  it. If you haven&#8217;t used WordPress, give it a try by installing it on your own  computer using a web server package like <a href="http://sixrevisions.com/tutorials/web-development-tutorials/using-xampp-for-local-wordpress-theme-development/" title="Using XAMPP for Local WordPress Theme Development - sixrevisions.com">xampp</a> or <a href="http://sixrevisions.com/web-development/install-wordpress-on-your-computer-using-wampserver/" title="Install WordPress on Your Computer Using WampServer - sixrevisions.com">WampServer</a>.  You&#8217;ll need access to WordPress in order to follow along with this guide.</p>
<p>In this guide, we will take a look at some common functions  in WordPress for use in custom WordPress theme development.</p>
<p><span id="more-4411"></span></p>
<h3>Introduction</h3>
<p>As a developer, one of my favorite things about WordPress is  its built-in functions, which allow you to easily manipulate and extend  WordPress with just a few lines of code.</p>
<p><a href="http://codex.wordpress.org/Function_Reference" title="Function Reference - WordPress Codex - codex.wordpress.org">WordPress functions</a> are an essential component of WordPress theme development; once you understand how  they work, it&#8217;s easy to create your own custom WordPress themes.</p>
<h3>Navigation</h3>
<p>The most popular sets of functions in WordPress are  navigation-related functions. For navigation menus, a popular function for  dynamically generating them is to use the <code>wp_list_pages</code> WordPress  function. Another method for dealing with site navigation was recently  introduced in <a href="http://sixrevisions.com/wordpress/wordpress-3-0-guide/" title="WordPress 3.0: Ultimate Guide to New Features - sixrevisions.com">WordPress  3.0</a>: the <code>wp_nav_menu</code> function.</p>
<p>We&#8217;ll talk about these two functions, starting with  <code>wp_list_pages</code>. </p>
<h4>Listing All Pages</h4>
<p>If you want to list all of the pages you&#8217;ve got (note that <a href="http://en.support.wordpress.com/post-vs-page/" title="Post vs. Page - Support - en.support.wordpress.com">pages and posts</a> have different meanings in WordPress vernacular), there&#8217;s a simple function for  that called <code>wp_list_pages</code>. When used without any parameters, it will list  all of your pages in alphabetical order.</p>
<pre>
&lt;?php wp_list_pages(); ?&gt;
</pre>
<h4>Listing Specific Pages</h4>
<p>As with many WordPress functions, the <code>wp_list_pages</code> function  takes several parameters. For example, the <code>include</code> parameter allows you  to list specific pages by referencing their page IDs, separated by commas (,).  The following example will only list two pages (the pages have IDs of 4 and 5).</p>
<pre>
&lt;?php wp_list_pages('include=4,5'); ?&gt;
</pre>
<h4>Excluding Specific Pages from a List</h4>
<p>You can also exclude specific pages using the <code>exclude</code>  parameter:</p>
<pre>
&lt;?php wp_list_pages('exclude=4,5'); ?&gt;
</pre>
<h4>Sorting Pages</h4>
<p>As discussed earlier, the default sorting order of <code>wp_list_pages</code> is alphabetical.  You can, however, change the order of the listing using the <code> sort_column</code>  parameter. The <code> sort_column</code> parameter can have 1 of 7 values:</p>
<ul>
<li><code>post_title</code> &#8211; Sort alphabetically (default value)</li>
<li><code>menu_order</code> &#8211; Sort by <a href="http://wordpress.org/support/topic/how-to-rearrange-page-order-in-navigation-sidebar" title="Page order in navigation - wordpress.org">page order</a></li>
<li><code>post_date</code> &#8211; Sort by date of creation</li>
<li><code>post_modified</code> &#8211; Sort by time last modified</li>
<li><code>ID</code> &#8211; Sort by page ID</li>
<li><code>post_author</code> &#8211; Sort by the page author ID</li>
<li><code>post_name</code> &#8211; Sort alphabetically by post slug</li>
</ul>
<p>Here is the code for sorting by creation date instead of the  default alphabetical order:</p>
<pre>&lt;?php wp_list_pages('sort_column=post_date'); ?&gt;</pre>
<h4>Specifying the Depth</h4>
<p>Pages can have subpages, and subpages can have subpages.  What if you only wanted to list top-level pages but exclude their subpages? Controlling  the depth works great when using it to generate dropdown menus with submenus.</p>
<p>You can use the <code>depth</code> parameter like so:</p>
<pre>
&lt;?php wp_list_pages('depth=1'); ?&gt;
</pre>
<h4>Enabling WordPress 3.0&#8242;s Navigation Menu Feature</h4>
<p>If you&#8217;re wanting absolute control over your navigation,  using WordPress 3.0&#8242;s new menu function, <code>wp_nav_menu</code>, is the way to go. With  this function, you can add categories in menus, submenus and even insert external  links into navigation menus.</p>
<p>To take advantage of the built-in navigation menu  functionality, first you need to enable it in your theme. In your <em>functions.php</em> file located in the theme directory,  you&#8217;ll need to add the following:</p>
<pre>
&lt;?php add_theme_support( 'menus' ); ?&gt;
</pre>
<p>Next, place the following code in the location where you  want the menu to show on your site (this could be in your standard theme  template files such as <em>header.php</em> or <em>single.php</em>):</p>
<pre>
&lt;?php wp_nav_menu( array('menu' =&gt; '<em>[Menu Name]</em>' )); ?&gt;</pre>
<p>Replace <code><em>[Menu Name]</em></code> with what you want your menu to be  named.</p>
<p>You&#8217;ll then need to navigate to Appearance &gt; Menus and  create your menu with the same exact name. Everything from there is simply drag  and drop!</p>
<h3>Displaying Blog Information</h3>
<p>We&#8217;re moving on to getting and working with information  about the blog. WordPress has a function for getting and printing your  WordPress blog information called <code>bloginfo</code>. This is a good function to  use for themes that will be used in multiple domains. There are many parameters  you can use for <code>bloginfo</code>; to find all of them, read the <a href="http://codex.wordpress.org/Function_Reference/bloginfo">bloginfo WordPress Codex</a> documentation.</p>
<h4>Getting the Site&#8217;s URL</h4>
<p>Let&#8217;s say your site&#8217;s URL is <em>http://example.com</em>. If you want to print this out in the source,  you can use the <code>url</code> parameter.</p>
<pre>
&lt;?php bloginfo('url'); ?&gt;
</pre>
<p>This works great for absolute link references. For example,  if you wanted to reference your logo (let&#8217;s say the file name is <em>logo.png</em>) that is in a directory called <em>images</em>, you would do the following:</p>
<pre>
&lt;img src=&quot;&lt;?php bloginfo('url'); ?&gt;/images/logo.png&quot; /&gt;</pre>
<p>The above outputs:</p>
<pre>
&lt;img src=&quot; http://example.com/images/logo.png&quot; /&gt;</pre>
<h4>Getting the URL to the Current Theme</h4>
<p>To grab the current theme directory&#8217;s URL, you can use the <code>template_url</code> parameter. This makes your <a href="http://sixrevisions.com/wordpress/wordpress-theme-development-custom-versus-commercial/" title="WordPress Theme Development: Custom versus Commercial - sixrevisions.com">WordPress  themes</a> more flexible so that when you change the domain name or use it in  multiple domain names you don&#8217;t have to worry about changing anything that  references the theme&#8217;s location. You can use this parameter a number of ways,  such as for referencing custom external stylesheets, images, and JavaScript  libraries that are inside the theme directory.</p>
<pre>
&lt;?php bloginfo('template_url'); ?&gt;
</pre>
<h4>Getting the URL of Your RSS Feed</h4>
<p>The <code>bloginfo</code> function can also be used for getting other  URLs. For example, if you want to grab the RSS feed URL for your site, you can  use the <code>'rss2_url'</code> parameter:</p>
<pre>
&lt;?php bloginfo('rss2_url'); ?&gt;
</pre>
<p>If you wanted to create a link to your RSS feed, you could  use the following:</p>
<pre>
&lt;a href=&quot;&lt;?php bloginfo('rss2_url'); ?&gt;&quot;&gt;Link to RSS feed&lt;/a&gt;</pre>
<h3>Working with Content</h3>
<p>The <a href="http://codex.wordpress.org/The_Loop">WordPress  loop</a> is used to display your posts. A basic loop looks like this:</p>
<pre>&lt;?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?&gt;&lt;?php endwhile; endif; ?&gt;
</pre>
<p>Not much to look at right now, but it&#8217;s what&#8217;s going to go inside  the loop that really matters.</p>
<h4>Querying Posts</h4>
<p>First, let&#8217;s look at the most important function that goes inside  the loop called <code>query_posts</code>. <code>query_posts</code> only needs to be used if you  want to display information from another page, post or category than the one the  user is currently on. For example, on the front page (controlled by <em>index.php</em>, <em>home.php</em>, or <em>front-page.php</em> theme template files) you could use <code>query_posts</code> to show the three newest posts  in the hypothetical category called <em>Featured</em>.</p>
<p>You use <code>query_posts</code> not only to show different kinds  of content, but how much content matches the query as well.</p>
<h4>Displaying Posts in a Category</h4>
<p>Keeping with our <em>Featured</em> category example above, here&#8217;s how we&#8217;d show the three newest posts from the <em>Featured</em> category:</p>
<pre>
&lt;?php query_posts('category_name=Featured&amp;posts_per_page=3'); ?&gt;</pre>
<h4>Aside: Passing Multiple Parameters into Functions</h4>
<p>Notice that we passed two parameters into the  <code>query_post</code> function. The parameters we passed were <code>category_name</code>  and <code>post_per_page</code>.</p>
<p>In functions with more than one parameter, you can pass  multiple parameters all at once by separating them with an ampersand (&amp;).  You can pass as many parameters as you want. Doing so allows you to increase  the specificity of your desired outputs.</p>
<h4>Excluding Posts</h4>
<p>Similar to  <code>wp_list_pages</code>, <code>query_posts</code> has a  way to exclude items from being displayed. To do so, you just place a minus  character (-) in front of the ID of the items you want to exclude.</p>
<p>For example, let&#8217;s say you would like to list all posts  except posts from two categories with category IDs of <em>97</em> and <em>34</em>. You could use the <code>cat</code>  parameter (which is typically used to display only posts within certain  categories) for <code>query_posts</code>:</p>
<pre>
&lt;?php query_posts('cat=-97,-34'); ?&gt;
</pre>
<h4>Displaying Common Information</h4>
<p>Now let&#8217;s move on to some more functions we can use inside  the loop. Many of these functions can only be used inside the loop and may not  work if used outside of it. </p>
<p>Display the title of the post:</p>
<pre>
&lt;?php the_title(); ?&gt;
</pre>
<p>Display the URL of the post:</p>
<pre>
&lt;?php the_permalink(); ?&gt;
</pre>
<p>Display the content of the post:</p>
<pre>
&lt;?php the_content(); ?&gt;
</pre>
<p>Display the excerpt of the post:</p>
<pre>
&lt;?php the_excerpt(); ?&gt;
</pre>
<p>Display the category of the post:</p>
<pre>
&lt;?php the_category(); ?&gt;</pre>
<p>Display the tags used in the post:</p>
<pre>
&lt;?php the_tags(); ?&gt;</pre>
<p>Display the time the post was published (uses <a href="http://us2.php.net/manual/en/function.date.php">PHP date formatting</a> as  a parameter): </p>
<pre>
&lt;?php the_time(); ?&gt;</pre>
<h3>Working with Custom Fields</h3>
<p>One of the most powerful functions that WordPress has that  seems to take developers a long time to learn is the use of <a href="http://codex.wordpress.org/Custom_Fields" title="Custom Fields - WordPress Codex - codex.wordpress.org">custom fields</a>.  Custom fields allow users to add custom name/value pairs typically used for post  metadata. For example, users can add a <code>post_thumbnail_url</code> key that has a  URL value pointing to the thumbnail image.</p>
<p>Users can add custom fields while they are creating posts and pages in Posts &gt; Add new or Pages &gt; Add new.</p>
<p><img src="http://images.sixrevisions.com/2010/11/13-02_custom_fields_example.png" width="544" height="183" alt="Working with Custom Fields" /></p>
<p>I&#8217;ve used custom fields for everything &#8212; from post  thumbnails and changing the background of the individual post to adding custom  link and layout areas. It becomes very powerful once you&#8217;ve learned it  properly.</p>
<p>Getting custom fields can be done from inside or outside of  the loop. If you use it outside the loop, you have to reference the ID of the post  or page you want the custom field name/value pair from.</p>
<h4>Using Custom Fields to Display Image Thumbnails</h4>
<p>Let&#8217;s say you want to display an image thumbnail in a post. </p>
<p>First, you must create a new post (Posts &gt; Add new). Under  the Custom Fields fieldset, type <em>Thumbnail</em> into the Name field and a URI for the Value field. Then publish the post.</p>
<p>Wherever in the loop you want the URI to be displayed,  simply use the <code>echo</code> statement to output the result of <code>get_post_meta</code>  (which is a function for getting custom fields).</p>
<pre>
&lt;?php echo get_post_meta($post-&gt;ID, 'Thumbnail', true); ?&gt;
</pre>
<p>To use <code>get_post_meta</code> outside the loop, change <code>$post-&gt;ID</code>  to the ID of the post. For example, here&#8217;s how to print the URI of the  thumbnail image for the post with ID of 6.</p>
<pre>
&lt;?php echo get_post_meta(6, 'Thumbnail', true); ?&gt;
</pre>
<p>Since we want to display an image, what we actually need to  do is use the <code>echo</code> statement inside the <code>src</code> attribute of an <code>img</code>  element:</p>
<pre>
&lt;img src=&quot;&lt;?php echo get_post_meta(6, 'Thumbnail', true); ?&gt;&quot; /&gt;
</pre>
<p>The code from above should output the following:</p>
<pre>&lt;img src=&quot;/images/thumbnail.jpg&quot; /&gt;
</pre>
<h3>Related Content</h3>
<ul>
<li><a href="http://sixrevisions.com/wordpress/how-to-customize-the-wordpress-admin-area/">How  to Customize the WordPress Admin Area</a></li>
<li><a href="http://sixrevisions.com/wordpress/taxonomy/">A  Guide to WordPress Custom Taxonomy</a></li>
<li><a href="http://sixrevisions.com/wordpress/wordpress-custom-post-types-guide/">WordPress  Custom Post Types Guide</a></li>
<li><em>Related categories</em>: <a href="http://sixrevisions.com/category/wordpress/">WordPress</a> and <a href="http://sixrevisions.com/category/web-development/">Web Development</a></li>
</ul>
<h3>About the Author</h3>
<p class="about-author"><img src="http://images.sixrevisions.com/authors/amber_weinberg_small.jpg" alt="" width="80" height="80" /><span class="author-bio-text"><strong>Amber Weinberg</strong> is a freelancer with over 10 years of experience. She&#8217;s the founder of <a href="http://codesnipp.it/"><strong>codesnipp.it</strong></a>, a social site for developers. She specializes in clean, semantic and valid 1.0 Strict XHTML, CSS and WordPress development. She also writes a web development blog on her portfolio site at&nbsp;<a href="http://www.amberweinberg.com" target="_blank"><strong>www.amberweinberg.com</strong></a><strong>.</strong></span></p>
]]></content:encoded>
			<wfw:commentRss>http://sixrevisions.com/wordpress/beginning-wordpress-development-a-look-at-common-functions/feed/</wfw:commentRss>
		<slash:comments>37</slash:comments>
		</item>
		<item>
		<title>A Guide to WordPress Custom Taxonomy</title>
		<link>http://sixrevisions.com/wordpress/taxonomy/</link>
		<comments>http://sixrevisions.com/wordpress/taxonomy/#comments</comments>
		<pubDate>Thu, 21 Oct 2010 10:00:28 +0000</pubDate>
		<dc:creator>Jacob Gube</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://sixrevisions.com/?p=4254</guid>
		<description><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4254&c=68681065' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4254&c=68681065' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br />In this guide, we will cover an incredibly great feature of WordPress: Custom taxonomy. Custom WordPress taxonomies give you unprecedented power in the way you can categorize and relate your WordPress content with each other. Though WordPress taxonomies were introduced in WordPress 2.3, it has been revamped in WordPress 3.0 for WordPress developers. Recently, we [...]]]></description>
			<content:encoded><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4254&c=679900552' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4254&c=679900552' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br /><p><a href="http://sixrevisions.com/wordpress/taxonomy/"><img src="http://images.sixrevisions.com/2010/10/17-01_wordpress_taxonomy_guide_ld_img.jpg" width="550" height="200" alt="A Guide to WordPress Custom Taxonomy" /></a></p>
<p>In this guide, we will cover an incredibly great feature of WordPress: Custom taxonomy. Custom WordPress taxonomies give you unprecedented power in the way you can categorize and relate your WordPress content with each other. Though WordPress taxonomies were introduced in WordPress 2.3, it has been revamped in <a href="http://sixrevisions.com/wordpress/wordpress-3-0-guide/">WordPress 3.0</a> for WordPress developers.</p>
<p>Recently, we had looked at creating custom WordPress post types in the <a href="http://sixrevisions.com/wordpress/wordpress-custom-post-types-guide/">WordPress custom posts guide</a>, and to further our command of WordPress 3.0 site and theme development, we&#8217;re going to now  discuss custom taxonomies.</p>
<p><span id="more-4254"></span></p>
<h3>What is Taxonomy in WordPress?</h3>
<p>Taxonomy is simply a way of organizing data and, in the WordPress world, a <a href="http://codex.wordpress.org/WordPress_Taxonomy" target="_blank" title="WordPress Taxonomy - codex.wordpress.org">taxonomy</a> is a way of organizing and tying your site content together.</p>
<p>Even though you don&#8217;t realize it, you&#8217;re probably already very familiar with at least one of the built-in WordPress taxonomies: WordPress tags. Tags are a taxonomy because posts can be linked to tags, viewed by tag, and organized by tags. Another WordPress taxonomy are post categories.</p>
<p>Taxonomies add a lot of power to WordPress because they allow users to filter the information they want to see on your site.</p>
<p>A custom taxonomy is exactly what it sounds like &#8212; a custom way to relate disparate content together. Custom taxonomies can be applied to custom post types or to regular pages and posts.</p>
<p>Here are some things you might use custom taxonomies for:</p>
<ul>
<li>Release Year for movies</li>
<li>Urgency like <em>High Priority</em>, <em>Low Priority</em> for service bulletins</li>
<li>Location like <em>room name</em>, <em>zip code</em> or <em>state</em> for events</li>
</ul>
<p>Each of these taxonomies could help to organize information stored in a WordPress site. If you read the <a href="http://sixrevisions.com/wordpress/wordpress-custom-post-types-guide/">custom post types guide</a>, than the last example (events) on that list will be  familiar.</p>
<h3>The Game Plan</h3>
<p>We&#8217;re going to build on the Event custom post type we produced in the <a href="http://sixrevisions.com/wordpress/wordpress-custom-post-types-guide/">WordPress custom post types guide</a> by creating a custom taxonomy for it called <em>Location</em>. The Location taxonomy will allow us to organize our events by their location.</p>
<p>Before we begin, a couple of caveats.</p>
<p>First, for the purposes of this guide, we&#8217;ll be using the <a href="http://wordpress.org/extend/themes/twentyten">default TwentyTen theme</a> that comes with WordPress 3 so that we all have the same base theme. However, these instructions can be adapted quite easily for using your own theme.</p>
<p>We&#8217;ll also be assuming that you followed along the <a href="http://sixrevisions.com/wordpress/wordpress-custom-post-types-guide/">custom post types guide</a> and that you already have the custom Event post type created.</p>
<p>OK, with that said, let&#8217;s get started!</p>
<h3>Creating a Custom Taxonomy</h3>
<p>As with custom post types, WordPress makes it pretty simple to create your own custom taxonomy.</p>
<p>Let&#8217;s take a look at the code required to create the Location custom taxonomy:</p>
<pre>
add_action( 'init', 'create_locations' );
function <strong>create_locations()</strong> {
 <strong>$labels</strong> = array(
    'name' =&gt; _x( 'Locations', 'taxonomy general name' ),
    'singular_name' =&gt; _x( 'Location', 'taxonomy singular name' ),
    'search_items' =&gt;  __( 'Search Locations' ),
    'all_items' =&gt; __( 'All Locations' ),
    'parent_item' =&gt; __( 'Parent Location' ),
    'parent_item_colon' =&gt; __( 'Parent Location:' ),
    'edit_item' =&gt; __( 'Edit Location' ),
    'update_item' =&gt; __( 'Update Location' ),
    'add_new_item' =&gt; __( 'Add New Location' ),
    'new_item_name' =&gt; __( 'New Location Name' ),
  ); 	

<strong>  register_taxonomy('location','event',array(
    'hierarchical' =&gt; true,
    'labels' =&gt; $labels
  ));</strong>
}</pre>
<p>The above code should go in the <code>functions.php</code> file inside your theme&#8217;s directory. The <code><a href="http://codex.wordpress.org/Function_Reference/register_taxonomy">register_taxonomy</a></code> WordPress function is what actually creates the taxonomy, so let&#8217;s start by looking at a couple of the arguments that we passed to it.</p>
<p><code>'location'</code> is the internal name of our taxonomy.</p>
<p><code>'event'</code> tells WordPress what post types will use this taxonomy. In our case, we&#8217;re tying it to our custom Event post type. You could replace this with <code>'post'</code> or <code>'page'</code> if you wanted to use your taxonomy on your posts and pages. You could also pass in multiple post types (via an array) so that multiple types of content can use the taxonomy.</p>
<p><code>array(...)</code> is the last argument to <code>register_taxonomy</code>. It&#8217;s a PHP array of options that tells WordPress how this taxonomy will work.</p>
<p>Let&#8217;s go over the keys inside the array argument.</p>
<p><code>'hierarchical'</code> is a boolean key that states whether or not the taxonomy has a hierarchy, i.e., whether the taxonomy has child categories or not. For our Location taxonomy, we are going to have a hierarchy. For example, think: Building 1, Conference Room A. There may be several Conference Room A&#8217;s, but since its parent is Building 1, then we are able to give our location greater specificity.</p>
<p><code>'labels'</code> is simply information about the way the taxonomy information is going to be printed (as specified by the <code>$labels</code> array inside the <code>create_locations</code> function).</p>
<p>Also notice that the <code>register_taxonomy</code> call is inside a function called <code>create_locations</code>. This is a custom function of ours (it can be named anything you want) that is called when WordPress initializes <code>add_action( 'init', 'create_locations' )</code>.</p>
<p>Still with me? I know it&#8217;s a lot, but let&#8217;s keep moving forward and soon it will all come together.</p>
<h3>Adding Your Custom Taxonomy to Posts</h3>
<p>OK, now that we&#8217;ve created the Location taxonomy, let&#8217;s log into WordPress and create some locations that we can use with our events.</p>
<p>If you look under the Events menu (on the left-hand side of the administration screen), you can see there is a new link called &quot;Locations&quot;. Clicking on it will bring you to a screen where you can add, edit, and remove locations from the system.</p>
<p><img src="http://images.sixrevisions.com/2010/10/17-02_wordpress_taxonomy_add_location.png" width="550" height="589" alt="Adding Your Custom Taxonomy to Posts" /></p>
<p>Create the following locations:</p>
<ol>
<li>Building 1</li>
<li>Conference Room A</li>
<li>Conference Room B</li>
</ol>
<p>Once you do, you should see your new locations in the Location table (right next to the <em>Add Location</em> interface).</p>
<p><img src="http://images.sixrevisions.com/2010/10/17-03_wordpress_taxonomy_table.png" width="566" height="259" alt="Adding Your Custom Taxonomy to Posts" /></p>
<p>Now that we have some locations, let&#8217;s add them to an Event post! Head over the <em>Add New Event</em> screen (or edit an existing event), and you should see a new Locations widget on the right-hand side. This widget appears because when we created the taxonomy, we told WordPress to associate it with the Event custom post type.</p>
<p><img src="http://images.sixrevisions.com/2010/10/17-04_wordpress_taxonomy_check.png" width="301" height="550" alt="Adding Your Custom Taxonomy to Posts" /></p>
<p>Check off <em>Conference Room A</em> and then publish or save the event. Notice that you can add new locations right from this screen if you find that there&#8217;s one missing. This whole display should be familiar to you as it works exactly like WordPress post categories. If you make a non-hierarchical taxonomy, then it will behave exactly like post tags.</p>
<p>Now that we&#8217;ve created some locations and used one of them to an Event post, we want to display each event&#8217;s location on the front-end of the site so that our readers can see them. Let&#8217;s do that next.</p>
<h3>Displaying Your Taxonomy Information</h3>
<p>The first place we want to show the location is when we are displaying a single event.</p>
<p>If you remember back in the previous custom post types guide, we created a file called <code>single-event.php</code> in our theme directory that was used to display an individual event. If you were doing a custom taxonomy on a default content type (i.e. posts or pages), then you can do the same thing, but only you&#8217;d need to do it in <code>single.php</code>.</p>
<p>When we visited an event, it looked like this:</p>
<p><img src="http://images.sixrevisions.com/2010/10/17-05_wordpress_taxonomy_displayed.jpg" width="437" height="464" alt="Displaying Your Taxonomy Information" /></p>
<p>We can add the location (or locations) to the post using WordPress&#8217;s <code><a href="http://codex.wordpress.org/Function_Reference/get_the_term_list" title="get the term list - codex.wordpress.org">get_the_term_list</a></code> function, which looks like this:</p>
<pre>get_the_term_list( $id, $taxonomy, $before, $sep, $after )</pre>
<p>Here are brief descriptions of each <code>get_the_term_list</code> argument:</p>
<ol>
<li><code>$id</code> &#8211; the ID of the event to get the taxonomy for</li>
<li><code>$taxonomy</code> &#8211; what taxonomy to get (<code>'tag'</code>, <code>'location'</code>, etc.)</li>
<li><code>$before</code> &#8211; The HTML to print before the list</li>
<li><code>$sep</code> &#8211; what should separate the various items in the list</li>
<li><code>$after</code> &#8211; The HTML to print after the list</li>
</ol>
<p>We can use the <code>get_the_term_list</code> function to display all locations assigned to an event using the following code block:</p>
<pre>&lt;?php echo get_the_term_list( get_the_ID(), 'location', "Location: " ) ?&gt;</pre>
<p>This tells WordPress to print the current Event&#8217;s ID (<code>get_the_ID()</code>), use our Location taxonomy, and prepend the list with the text, &quot;Location: &quot;.</p>
<p>We won&#8217;t worry about specifying a separator since the default (which is a comma) will work just fine. You could use another separator if you want, like &#8211; or |.</p>
<p>One other thing to note is that each displayed location will automatically be a link to a page that shows all posts that have the same location. (We&#8217;ll talk about how to customize that page in a bit).</p>
<p>To add the location&#8217;s list to our <code>single-event.php</code> file, replace the following section:</p>
<pre>&lt;div class="entry-meta"&gt;
&lt;?php twentyten_posted_on(); ?&gt;
&lt;/div&gt;&lt;!-- .entry-meta --&gt;
&lt;/pre&gt;
</pre>
<p>With:</p>
<pre>
&lt;div class="entry-meta"&gt;
&lt;?php twentyten_posted_on(); ?&gt;
&lt;/div&gt;&lt;!-- .entry-meta --&gt;
&lt;div class="entry-meta"&gt;
&lt;?php echo get_the_term_list( get_the_ID(), 'location', "Location: " ) ?&gt;
&lt;/div&gt;&lt;!-- .entry-meta --&gt;
</pre>
<p>Now if we refresh the event&#8217;s page in our browser, we can now see the location assigned to it:</p>
<p><img src="http://images.sixrevisions.com/2010/10/17-07_wordpress_taxonomy_error_notfount.jpg" width="491" height="476" alt="Filtering Posts by Custom Taxonomy" /></p>
<h3>Filtering Posts by Custom Taxonomy</h3>
<p>Now that we&#8217;re displaying our Location taxonomy in our events pages, we need to configure a page template to show all the events for a given location.</p>
<p>As noted previously, the &quot;Conference Room A&quot; link will automatically take you to a page that displays all the posts with the given location (which is pretty useful for when you want to know what other events will be happening in &quot;Conference Room A&quot;).</p>
<p>But since we&#8217;re tying our taxonomy to a custom event type, we&#8217;ll need to get our hands a little dirty and make some modifications.</p>
<p>If we follow the link as-is, we&#8217;ll see the following:</p>
<p><img src="http://images.sixrevisions.com/2010/10/17-06_wordpress_taxonomy_location_displayed.jpg" width="550" height="408" alt="Filtering Posts by Custom Taxonomy" /></p>
<p>To understand what&#8217;s going on, we need to know a little about WordPress&#8217;s <a href="http://codex.wordpress.org/Template_Hierarchy">template hierarchy</a>. Whenever a page is loaded in WordPress, it looks in your theme for the correct template to load based on a specified naming convention. When a taxonomy page is encountered by the user, the sequence in which WordPress checks what WordPress theme page template to use is this: <code>taxonomy-<em>[your_taxonomy_term]</em>.php</code> &gt; <code>taxonomy-taxonomy.php</code> &gt; <code>taxonomy.php</code> &gt; <code>archive.php</code> &gt; <code>index.php</code>.</p>
<p>What this means is that, going left to right, WordPress will use the first file it encounters that matches the naming convention. In the TwentyTen WordPress theme, the first file that is a match is <code>archive.php</code> since the first three files are non-existent. That explains why we saw the &quot;Blog Archives&quot; heading in the page.</p>
<p>To display our locations, we&#8217;re going to add a file called <code>taxonomy-location.php</code>.</p>
<p>Since this is higher in the page template hierarchy (i.e., it&#8217;s <code>taxonomy-[taxonomy-term].php</code> from above), WordPress will load this file instead of <code>archive.php</code> when a user hits the location taxonomy page.</p>
<p>So to get started, create <code>taxonomy-location.php</code> in your theme&#8217;s directory and copy the contents of <code>tag.php</code> into it so that we have a starting point.</p>
<p>The first thing we need to do is get the location that we are currently viewing (like &quot;Conference Room A&quot;).</p>
<p>WordPress terminology calls this the <em>term</em> of the current custom taxonomy. To get the terms of an event post, add the following line right below the <code>get_header()</code> line.</p>
<pre>&lt;?php $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); ?&gt;
</pre>
<p>All of the term information (ID, name, etc.) is stored in the <code>$term</code> variable, so we can now output it wherever we want.</p>
<p>We are going to display the term at the top of the page, so let&#8217;s replace the tag heading with our own heading for location.</p>
<p>So go ahead and change this code block:</p>
<pre>&lt;h1 class="page-title"&gt;&lt;?php
printf( __( 'Tag Archives: %s', 'twentyten' ), '&lt;span&gt;' . single_tag_title( '', false ) . '&lt;/span&gt;' );
?&gt;&lt;/h1&gt;
</pre>
<p>To:</p>
<pre>&lt;h1 class="page-title"&gt;&lt;?php
printf( __( 'Events in Location: %s', 'twentyten' ), '&lt;span&gt;' . $term-&gt;name . '&lt;/span&gt;' );
?&gt;&lt;/h1&gt;
</pre>
<p>Now if we click on the &quot;Conference Room A&quot; link from our event, we can now see what location we are looking at. But there are still no events showing.</p>
<p><img src="http://images.sixrevisions.com/2010/10/17-08_wordpress_taxonomy_no_showing.jpg" width="550" height="393" /></p>
<p>To fix that, we need to modify the default <a href="http://codex.wordpress.org/The_Loop">WordPress loop</a> to manually find Events, and not just Posts.</p>
<p>Right below the line you added, add the following line so that we can make a custom WordPress query:</p>
<pre> &lt;?php query_posts(array( 'post_type'=&gt;'event', 'location'=&gt;$term-&gt;slug)); ?&gt;
</pre>
<p><code>query_posts</code> will override the default WordPress loop and replace it with a custom one that finds all Events with the current location.</p>
<p>Due to a bug in WordPress (at the moment), any other post types that are at the current location will also be returned. This is  not a problem for us right now, but is something to keep in mind in the future as you work with custom taxonomies.</p>
<p>Once we&#8217;ve added the <code>query_post</code> call, here&#8217;s what we see:</p>
<p><img src="http://images.sixrevisions.com/2010/10/17-09_wordpress_taxonomy_query_post.jpg" width="550" height="492" /></p>
<p>As you can see, we&#8217;re now showing all of our &quot;Conference Room A&quot; events (we only have one), awesome!</p>
<p>If you noticed, when originally creating the locations, you can optionally specify a location description. How would we add that to our template? That&#8217;s pretty easy. Just add the following line right under the closing <code>h1</code> tag in <code>taxonomy-location.php</code>.</p>
<pre> &lt;strong&gt;Description:&lt;/strong&gt;&lt;?php echo term_description( '', get_query_var( 'taxonomy' ) ); ?&gt;
</pre>
<p>Now our page will look like this:</p>
<p><img src="http://images.sixrevisions.com/2010/10/17-10_wordpress_taxonomy_done.jpg" width="550" height="495" /></p>
<p>And that&#8217;s it! We are now showing our custom taxonomy on individual Event pages and we can also list all events in a given location.</p>
<h3>Summary</h3>
<p>I hope that after reading this guide, you now have a good idea on how to set up your own custom WordPress taxonomies. This is what we did:</p>
<ol>
<li>Create a custom taxonomy (the Location taxonomy)</li>
<li>Add the Location taxonomy to posts (in this case, in the Event custom post type) </li>
<li>Display the custom taxonomy in posts</li>
<li>Filter and display posts by their custom taxonomy</li>
<li>Create a page template for our custom taxonomy</li>
</ol>
<p>With the inclusion of custom post types and the improvement of custom taxonomies in WordPress 3, the sky is really the limit in content creation.</p>
<p><strong><em>How are you going to use this new functionality?</em></strong></p>
<h3>Related Content</h3>
<ul>
<li><a href="http://sixrevisions.com/wordpress/wordpress-custom-post-types-guide/">WordPress Custom Post Types Guide</a></li>
<li><a href="http://sixrevisions.com/wordpress/30-excellent-wordpress-video-tutorials/">30 Excellent WordPress Video Tutorials</a></li>
<li><a href="http://sixrevisions.com/wordpress/wordpress-3-0-guide/">WordPress 3.0: Ultimate Guide to New Features</a></li>
<li><em>Related categories</em>: <a href="http://sixrevisions.com/category/wordpress/">WordPress</a> and <a href="http://sixrevisions.com/category/web-development/">Web Development</a></li>
</ul>
<h3>About the Author</h3>
<p class="about-author"><img src="http://images.sixrevisions.com/authors/john_gadbois_small.jpg" alt="" width="80" height="80" /><strong>John Gadbois</strong> is a 27-year-old web developer who codes and runs Domain Superstar, a <a href="http://www.domainsuperstar.com">domain name tools</a> site. He also works on the <a href="http://www.calculatorpro.com">online calculator</a> site, CalculatorPro.com and enjoys working with WordPress, PHP, jQuery, and Ruby on Rails.</p>
]]></content:encoded>
			<wfw:commentRss>http://sixrevisions.com/wordpress/taxonomy/feed/</wfw:commentRss>
		<slash:comments>51</slash:comments>
		</item>
		<item>
		<title>10 Basic Tips for Improving WordPress Themes</title>
		<link>http://sixrevisions.com/wordpress/improve-wordpress-themes-tips/</link>
		<comments>http://sixrevisions.com/wordpress/improve-wordpress-themes-tips/#comments</comments>
		<pubDate>Thu, 14 Oct 2010 11:00:58 +0000</pubDate>
		<dc:creator>Jacob Gube</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://sixrevisions.com/?p=4210</guid>
		<description><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4210&c=891611099' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4210&c=891611099' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br />A lot of people use WordPress as their blogging platform. After installing WordPress, newly christened WordPress users will usually try to find and download WordPress themes that they can use so that their site looks different from the default theme. Whether a WordPress theme is free or premium, there are plenty of ways to improve [...]]]></description>
			<content:encoded><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4210&c=835183793' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4210&c=835183793' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br /><p><a href="http://sixrevisions.com/wordpress/improve-wordpress-themes-tips/"><img src="http://images.sixrevisions.com/2010/10/11-01_improving_wordpress_themes_ld_img.jpg" width="550" height="250" alt="10 Tips for Improving WordPress Themes" /></a></p>
<p>A lot of people use WordPress as their blogging platform. After <a href="http://sixrevisions.com/tutorials/web-development-tutorials/using-xampp-for-local-wordpress-theme-development/" title="Using XAMPP for Local WordPress Theme Development">installing WordPress</a>, newly christened WordPress users will usually try to find and download WordPress themes that they can use so that their site looks different from the default theme. Whether a WordPress theme is <a href="http://sixrevisions.com/resources/50-beautiful-free-wordpress-themes/" title="50 Beautiful Free WordPress Themes - sixrevisions.com">free</a> or <a href="http://sixrevisions.com/wordpress/a-guide-to-premium-wordpress-themes/" title="A Guide to Premium WordPress Themes - sixrevisions.com">premium</a>, there are plenty of ways to improve them. The following WordPress theme tips cover basic customization, styling and optimization.</p>
<p><span id="more-4210"></span></p>
<h3>1. Reduce the Size of Theme Images</h3>
<p>Images are an important part of every WordPress theme, yet WordPress theme developers sometimes forget about optimizing them. Images in a WordPress theme include CSS background images, template logos, default stock images, icons, and so on.</p>
<p>Optimizing images can save you in bandwidth consumption and can <a href="http://sixrevisions.com/web-development/five-ways-to-speed-up-page-response-times/" title="Five Ways to Speed Up Page Response Times - sixrevisions.com">improve page response times</a> for your blog readers.</p>
<p>Photoshop, for example, offers a <em>Save for Web</em> feature that optimizes images for the web. What I usually do is lower the quality settings of the image until I start to see changes in color or quality.</p>
<p>Furthermore, you can use a lossless image optimization tool like <a href="http://www.smushit.com/ysmush.it/">Smush.it</a> that will squeeze out excess file size without  loss in image quality. You can find more image optimization tools <a href="http://sixrevisions.com/tools/8-excellent-tools-for-optimizing-your-images/" title="8 Excellent Tools for Optimizing Your Images">here</a>.</p>
<p><img src="http://images.sixrevisions.com/2010/10/11-02_yahoo_smushit.png" width="550" height="365" alt="Reduce the Size of Theme Images" /><span class="figure-caption"><a href="http://www.smushit.com/ysmush.it/">Yahoo! Smush.it</a> is a lossless compression tool.</span></p>
<p>Learn all about web image optimization via this <a href="http://sixrevisions.com/web_design/comprehensive-guide-saving-images-for-web/">guide to saving images for the web</a>.</p>
<h3>2. Use a Custom Favicon</h3>
<p>Some WordPress themes don&#8217;t come with a default <a href="http://en.wikipedia.org/wiki/Favicon">favicon</a> (the icon that represents a website that you can see in browser tabs and browser web address bars).</p>
<p><img src="http://images.sixrevisions.com/2010/10/11-05_add_wordpress_theme_favicon.png" width="550" height="179" alt="Add a Favicon" /><span class="figure-caption">The <a href="http://designinstruct.com/">Design Instruct</a> favicon displayed in Firefox 3.6. The site uses WordPress as a publishing platform.</span></p>
<p>When a website doesn&#8217;t have a favicon, it can look unprofessional. Make sure that your WordPress theme has a favicon. You can check out this list of <a href="http://sixrevisions.com/resources/favicon_generators_resources/" title="Favicon Generators - sixrevisions.com">favicon generators</a> to help you design your own.</p>
<p>To reference your WordPress icon, simply place the following code inside <code>header.php</code>, which can be found inside your theme&#8217;s directory:</p>
<pre>&lt;link rel=&quot;icon&quot; href=&quot;favicon.ico&quot; type=&quot;image/x-icon&quot; /&gt;</pre>
<p>Modify the <code>href</code> attribute value to point to the location of your favicon file.</p>
<h3>3. Style WordPress Image Captions</h3>
<p>When you upload and post an image in a blog post, you can give them image captions to describe it.</p>
<p>Every good WordPress theme should include  <a href="http://codex.wordpress.org/CSS#WordPress_Generated_Classes">default styles for image captions</a>. To style the default caption, you can use the <code>.wp-caption</code> class in your <code>styles.css</code>.</p>
<p>Here is an example of styling the image caption (using some CSS3 properties):</p>
<pre>
.wp-caption {
  background-color: #f3f3f3;
  border: 1px solid #ddd;
  -khtml-border-radius: 3px;
  -moz-border-radius: 3px;
  -webkit-border-radius: 3px;
  border-radius: 3px; /* optional rounded corners for browsers that support it */
  margin: 10px;
  padding-top: 4px;
  text-align: center;
}
.wp-caption img {
  border: 0 none;
  margin: 0;
  padding: 0;
}
.wp-caption p.wp-caption-text {
  font-size: 11px;
  line-height: 17px;
  margin: 0;
  padding: 0 4px 5px;
}</pre>
<p>Here is the result of the style rules above:</p>
<p><img src="http://images.sixrevisions.com/2010/10/11-06_add_wordpress_theme_captions.jpg" width="550" height="199" alt="Style WordPress Image Captions" /></p>
<h3>4. Use PHP Flush</h3>
<p>By calling the PHP <code>flush</code> function right after your header, you will be able to speed up your WordPress blog. Simply add this line to your <code>header.php</code> file after the closing <code>&lt;/head&gt;</code> tag:</p>
<pre>&lt;?php flush(); ?&gt;</pre>
<p>This code simply forces your web server to send your website&#8217;s header before sending the rest of the content. By using the <code>flush</code> function, the browser has time to download all the stylesheets referenced in the header while waiting for the other parts of the web page.</p>
<h3>5. Use Shorthand CSS in Your Theme&#8217;s Stylesheet</h3>
<p>The CSS files of WordPress themes contain lots and lots of code to cover all sorts of situations and usage. In order to reduce the size of the file, you can use shorthand CSS. Some WordPress theme designers will make it easier for less advanced users to tweak the styles by not using shorthand properties, but if you&#8217;re an experienced CSS coder, you can write/re-write the styles using shorthand properties.</p>
<p>For example, if you find style rules in your theme that look like this:</p>
<pre>
.post {
  padding-top:3px;
  padding-right:10px;
  padding-bottom:5px;
  padding-left:2px;
}</pre>
<p>You could reduce them to their shorthand equivalent as such:</p>
<pre>.post { padding: 3px 10px 5px 2px; }</pre>
<p>This will effectively reduce the size of your stylesheet. Changing this won&#8217;t make that much of a difference, but every bit of optimization brings you a little closer to a faster WordPress theme.</p>
<h3>6. Minify Your WordPress Theme Files</h3>
<p>Congruent with using shorthand properties for CSS to optimize <code>styles.css</code>, if your theme&#8217;s CSS and JavaScript files aren&#8217;t minified, you can minify them to reduce their file sizes. Minification will take out unneeded characters from your files such as spaces and tabs.</p>
<p>For JavaScript, you can use <a href="http://www.minifyjavascript.com/">JavaScript Compressor</a>, a free web-based tool that you can use to minify your JavaScript files.</p>
<p>For CSS, check out this <a href="http://sixrevisions.com/css/css_code_optimization_formatting_validation/" title="Web-Based Tools for Optimizing, Formatting and Checking CSS - sixrevisions.com">list of CSS optimizers</a>.</p>
<p>It will be trickier to minify your HTML since the theme&#8217;s markup is spread amongst several files and they will have PHP code interspersed with them. However, there are plugins like <a href="http://wordpress.org/extend/plugins/w3-total-cache/">W3 Total Cache</a> that will minify all of your front-end code as well as perform other optimization processes such as caching your blog posts to improve site speed.</p>
<h3>7. Secure the Theme</h3>
<p>One easy way to protect your theme is to remove the generic WordPress generator code that is placed inside your theme&#8217;s <code>&lt;head&gt;</code> tags. The reason behind this is that if a malicious user knows your WordPress version, it&#8217;s a lot easier for him to attack it using version-specific vulnerabilities. In order to remove this, you have to take two steps.</p>
<p>First, go to your theme&#8217;s <code>header.php</code> file and check to see if there is a line like this:</p>
<pre>&lt;meta name=&quot;generator&quot; content=&quot;WordPress &lt;?php bloginfo(’version’); ?&gt;&quot; /&gt;</pre>
<p>If that&#8217;s the case, then remove the line. This line prints out your WordPress version number as a <code>&lt;meta&gt;</code> tag.</p>
<p>Next, in order to ensure that it doesn&#8217;t show up via the <code>wp_head()</code> hook, simply paste this code into the <code>functions.php</code> file (if <code>functions.php</code> doesn&#8217;t exist, you can just create one using your favorite <a href="http://sixrevisions.com/web-development/the-15-most-popular-text-editors-for-developers/" title="The 15 Most Popular Text Editors for Developers - sixrevisions.com">source code editor</a>):</p>
<pre>&lt;?php remove_action('wp_head', 'wp_generator');&nbsp;?&gt;</pre>
<h3>8. Hide Dashboard Login Errors</h3>
<p>Another way to protect your WordPress theme is to hide login errors. The reason is that whenever you are trying to login using the correct username but with the wrong password, a message will show up saying &quot;Error: Incorrect Password.&quot; You&#8217;ve now given a clue that the username entered is in the system, and that they simply need to crack its password. </p>
<p><img src="http://images.sixrevisions.com/2010/10/11-03_wordpress_theme_dashboard_error.png" width="550" height="355" alt="Hide Dashboard Login Errors" /></p>
<p>Similarly, whenever you enter an unavailable username, a message appears stating &quot;Error: Invalid username&quot;. This of course reveals that the username is non-existent and becomes one less permutation that needs to be checked.</p>
<p>In order to keep this from happening, you need to add this code to your <code>functions.php</code> file:</p>
<pre>add_filter('login_errors', create_function('$a', &quot;return&nbsp;null;&quot;));</pre>
<p>This filter will remove the standard WordPress error by displaying nothing when a login is incorrect.</p>
<h3>9. Replace the Theme&#8217;s Search Feature</h3>
<p>Most themes you download will use the default search function in WordPress core, specifically because it is a <a href="http://codex.wordpress.org/Theme_Development#Template_File_Checklist">best practice recommended by WordPress core developers</a> for developing and distributing WordPress themes.</p>
<p>However, the core search function, at the moment, is not as robust and accurate as a third-party search service such as <a href="http://www.google.com/cse/">Google Custom Search</a>, <a href="http://developer.yahoo.com/search/boss/">Yahoo! Search BOSS</a>, or the <a href="http://www.bing.com/developers">Bing API</a>. For example, in the WordPress core search function, typing a blog post author&#8217;s name will not yield a result (unless you include it in your posts as a custom field).</p>
<p><img src="http://images.sixrevisions.com/2010/10/11-04_google_custom_search.png" width="550" height="242" alt="Replace the Theme's Search Feature with Google Custom Search" /></p>
<p>On the other hand, using web services provided by Google, Yahoo!, and Microsoft&#8217;s Bing will not only take advantage of their expertise in search, but can also help reduce your server load for searches.</p>
<p>For integrating Google Custom Search to your WordPress theme, check out the <a href="http://wordpress.org/extend/plugins/google-custom-search-for-wordpress/">Google Custom Search Plugin</a> or this tutorial called <a href="http://www.catswhocode.com/blog/integrate-google-search-on-your-blog">Integrate Google Search on your WordPress blog</a>.</p>
<p>For Yahoo! Search BOSS, see the <a href="http://wordpress.org/extend/plugins/yahoo-boss/">Yahoo BOSS</a> WordPress plugin or this tutorial entitled <a href="http://www.labnol.org/internet/tutorial-create-yahoo-boss-site-search/5636/">Create a Yahoo BOSS powered Site Search Engine</a>.</p>
<p>Finally, if you&#8217;re interested in the Bing API (which is being currently used for one of the largest WordPress blogs in the world, <a href="http://mashable.com/?s=Six+Revisions">Mashable</a>), have a look at this tutorial named <a href="http://blog.calevans.com/2010/06/01/bing-search-api-wrapper-for-php/">Bing Search API wrapper for PHP</a>.</p>
<h3>10. Reduce Function Calls and Hooks for Static Content</h3>
<p>Theme files for mass consumption and use under diverse situations need to be flexible. As such, there are plenty of dynamic function calls and hooks to make the theme work in multiple ways and situations.</p>
<p>However, this can lead to lower performance and page speeds because every time a page is generated, it needs to make multiple function calls to render the page.</p>
<p>Look out for things that don&#8217;t need to be function calls; pay attention to things that are unlikely to change.</p>
<p>For example, in <code>header.php</code>, you might find a line that looks like this:</p>
<pre>&lt;title&gt;&lt;?php bloginfo('name'); ?&gt;&lt;/title&gt;</pre>
<p>This line prints out your blog&#8217;s name in the browser&#8217;s title bar. Your blog&#8217;s name probably won&#8217;t change often, if at all, so you could reduce a needed function call by replacing it with your blog name, like so:</p>
<pre>&lt;title&gt;Your Blog Name&lt;/title&gt;</pre>
<p>Here&#8217;s another example (again, usually found in <code>header.php</code>):</p>
<pre>&lt;link rel=&quot;stylesheet&quot; href=&quot;&lt;?php bloginfo('stylesheet_url'); ?&gt;&quot; type=&quot;text/css&quot; /&gt;</pre>
<p>The above example references the URL of your stylesheet. However, it&#8217;s unlikely this URL will change, so you can just directly write the URL like so: </p>
<pre>&lt;link rel=&quot;stylesheet&quot; href=&quot;http://example.com /wp-content/themes/themename/style.css&quot; type=&quot;text/css&quot; /&gt;</pre>
<p>There are plenty of these function calls for non-custom WordPress themes, and collectively, they can contribute to the sluggishness of your WordPress blog, especially when you aren&#8217;t using a caching plugin.</p>
<p><strong><em>Share your own tips for improving WordPress themes in the comments.</em></strong></p>
<h3>Related Content</h3>
<ul>
<li><a href="http://sixrevisions.com/wordpress/optimizing-wordpress-for-search-engines/">Optimizing WordPress for Search Engines</a></li>
<li><a href="http://sixrevisions.com/tools/8-excellent-tools-for-optimizing-your-images/">8 Excellent Tools for Optimizing Your Images</a></li>
<li><a href="http://sixrevisions.com/web-development/10-ways-to-improve-your-web-page-performance/">10 Ways to Improve Your Web Page Performance</a></li>
<li><em>Related categories</em>: <a href="http://sixrevisions.com/category/wordpress/">WordPress</a> and <a href="http://sixrevisions.com/category/web-development/">Web Development</a></li>
</ul>
<h3>About the Author</h3>
<p class="about-author"><img src="http://images.sixrevisions.com/authors/julius_kuhn-regnier_small.jpg" alt="" width="80" height="80" /><strong>Julius Kuhn-Regnier</strong> is an Internet marketer and blogger. Read more of his work on his <a href="http://andbreak.com/">Internet marketing blog</a>, <em>And Break</em>, where he aims to teach people ways you can make a living online. He has also created a great guide about <a href="http://andbreak.com/articles/guide-speed-wordpress/">speeding up WordPress</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://sixrevisions.com/wordpress/improve-wordpress-themes-tips/feed/</wfw:commentRss>
		<slash:comments>69</slash:comments>
		</item>
		<item>
		<title>WordPress Custom Post Types Guide</title>
		<link>http://sixrevisions.com/wordpress/wordpress-custom-post-types-guide/</link>
		<comments>http://sixrevisions.com/wordpress/wordpress-custom-post-types-guide/#comments</comments>
		<pubDate>Tue, 05 Oct 2010 10:00:11 +0000</pubDate>
		<dc:creator>Jacob Gube</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://sixrevisions.com/?p=4172</guid>
		<description><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4172&c=2061730456' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4172&c=2061730456' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br />One of the most anticipated features of WordPress 3.0 was the ability to add your own custom post types to WordPress, which allows you to display and categorize different types of content outside of the 5 native WordPress content types (i.e. Post, Page, Attachment, and so forth). The addition of this feature is a big [...]]]></description>
			<content:encoded><![CDATA[<a href='http://rss.buysellads.com/click.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4172&c=1642086372' target='_blank'><img src='http://rss.buysellads.com/img.php?z=1259902&k=6989dd4b5220d0b14530453de7387991&a=4172&c=1642086372' border='0' alt='' /></a><p><a href='http://buysellads.com/buy/sitedetails/pubkey/6989dd4b5220d0b14530453de7387991/zone/1259902' target='_blank'>Advertise here with BSA</a></p><br /><p><a href="http://sixrevisions.com/wordpress/wordpress-custom-post-types-guide/"><img src="http://images.sixrevisions.com/2010/10/06-01_wordpress_custompost_type_ld_img.jpg" width="550" height="200" alt="WordPress Custom Post Types Guide" /></a></p>
<p>One of the most <a href="http://sixrevisions.com/wordpress/wordpress-3-0-guide/" title="WordPress 3.0: Ultimate Guide to New Features - sixrevisions.com">anticipated features of WordPress 3.0</a> was the ability to add your own custom post types to WordPress, which allows you to display and categorize different types of content outside of the 5 native WordPress content types (i.e. Post, Page, Attachment, and so forth). The addition of this feature is a big step forward in making WordPress a full-fledged CMS, extending outside its normal use as a blogging platform.</p>
<p>			<span id="more-4172"></span></p>
<p>In this guide, we&#8217;ll go through the process of creating and using your own custom post type. More specifically, we will create an &quot;Event&quot; post type for your special events and dates, sort of like a calendar.</p>
<h3>What is a Custom Post Type?</h3>
<p>If you&#8217;re familiar with WordPress, then I&#8217;m sure you&#8217;ve already had some exposure to the default WordPress post types used for content creation: Post and Page. Almost all of the content in any WordPress site prior to 3.0 is composed of some combination of posts and pages.</p>
<p>Posts are generally used for content that is updated frequently (blog posts, for example), and pages are generally used for static content (such as the <a href="http://sixrevisions.com/content-strategy/about-page-guidelines/" title="Guidelines for Writing a Good About Page - sixrevisions.com">About page</a> of a site).</p>
<p>Often, however, you may have a more specific type of data that you want to include on your site. This is where custom post types come in.</p>
<p>We&#8217;re going to create a custom post type that we&#8217;ll call &quot;Event&quot;. This content type will let us add events such as birthdays, holidays, conference dates, and so forth.</p>
<p>We&#8217;ll be working with the <a href="http://wordpress.org/extend/themes/twentyten" title="TwentyTen free WordPress theme - wordpress.org">default TwentyTen theme</a> that comes with WordPress 3.0 so that we have a uniform code base, but the concepts and techniques will be applicable to any theme.</p>
<h3>Creating a Custom Post Type</h3>
<p>Fortunately, WordPress makes it pretty easy to create a new custom post type. Let&#8217;s look at the code first and then I&#8217;ll explain how it works:</p>
<pre>add_action( 'init', 'create_events' );
function create_events() {
  $labels = array(
    'name' => _x('Events', 'post type general name'),
    'singular_name' => _x('Event', 'post type singular name'),
    'add_new' => _x('Add New', 'Event'),
    'add_new_item' => __('Add New Event'),
    'edit_item' => __('Edit Event'),
    'new_item' => __('New Event'),
    'view_item' => __('View Event'),
    'search_items' => __('Search Events'),
    'not_found' =>  __('No Events found'),
    'not_found_in_trash' => __('No Events found in Trash'),
    'parent_item_colon' => ''
  );

  $supports = array('title', 'editor', 'custom-fields', 'revisions', 'excerpt');

  register_post_type( 'event',
    array(
      'labels' => $labels,
      'public' => true,
      'supports' => $supports
    )
  );
}</pre>
<p>The above code should be placed in the <code>functions.php</code> file of your theme.</p>
<p>A few notes about the code:</p>
<ul>
<li><code>add_action</code> tells WordPress to call our <code>create_events()</code> function when WordPress initializes</li>
<li>The <code>$labels</code> array tells WordPress how to display messages about our custom post type</li>
<li>The <code>$supports</code> array tells WordPress what our post type supports (Can it have an excerpt? &#8211; for instance)</li>
<li><code>register_post_type</code> actually registers our new post type with WordPress</li>
<li>The <code>register_post_type</code> function is very customizable and has many more options than those that we are actually using; you can see all of these at the <a href="http://codex.wordpress.org/Function_Reference/register_post_type">WordPress Codex</a>.</li>
</ul>
<p>Once we add this code to <code>functions.php</code>, we can see our new post type in the WordPress Admin section.</p>
<p><img src="http://images.sixrevisions.com/2010/10/06-02_wordpress_custom_post_type_registered.png" width="549" height="284" alt="WordPress Custom Post Type" /></p>
<p>Let&#8217;s go ahead and add and publish a new Event. You can publish a new Event just like you would a regular Post.</p>
<p><img src="http://images.sixrevisions.com/2010/10/06-03_wordpress_custom_post_type_publish_new_type.png" width="550" height="413" alt="WordPress Custom Post Type" /></p>
<h3>Displaying a Custom Post Type</h3>
<p>Now that we&#8217;ve published our event, we can view it like any other post. If you edit your event and then click on the &quot;View Event&quot; button, you&#8217;ll see that the event is displayed like any other post.</p>
<p><img src="http://images.sixrevisions.com/2010/10/06-04_wordpress_custom_post_type_just_like_post.jpg" width="550" height="451" alt="WordPress Custom Post Type" /></p>
<p>However, the reason we typically create a custom post type is because we want it to look and act differently from a regular post. </p>
<p>Again, WordPress provides a nice mechanism for customizing how our custom post looks. If you&#8217;ve done work on WordPress themes in the past, you probably know that a single blog post is displayed using the <code>single.php</code> theme file. WordPress 3.0 allows you to add a <code>single-[your_post_type_name].php</code> file to override how a custom post type is displayed. Notice the format of this file name: <code>single-</code> followed by the name you assigned your custom post type.</p>
<p>For our Event type, create a <code>single-event.php</code> file and copy the contents of <code>single.php</code> into it. To keep it simple, we&#8217;ll just change one line in <code>single-event.php</code> to show that it is really working. Find the line that is outputting the Event title in <code>single-event.php</code>; it should look like the following:</p>
<pre> &lt;h1 class="entry-title"&gt;&lt;?php the_title(); ?&gt;&lt;/h1&gt;
</pre>
<p>Let&#8217;s change it to:</p>
<pre> &lt;h1 class="entry-title"&gt;Event: &lt;?php the_title(); ?&gt;&lt;/h1&gt;
</pre>
<p>If we go back and look at our Event webpage now, we can see that it is showing our changes.</p>
<p><img src="http://images.sixrevisions.com/2010/10/06-05_wordpress_custom_post_type_updated.jpg" width="551" height="448" alt="WordPress Custom Post Type" /></p>
<p>Any other changes that you make to <code>single-event.php</code> will be visible when viewing an event.</p>
<h3>Listing Our Custom Post Type</h3>
<p>Now that we&#8217;ve seen how to display one of our events, how do we go about listing all of our events? Displaying single events is useful, but its functionality is limited unless we can see all of our events.</p>
<p>There are a couple of different ways to do this, but unfortunately, none of them are particularly straightforward. The most common way (and the way we&#8217;ll do it here) is to display a list of custom post types through the use of a custom <a href="http://codex.wordpress.org/Pages#Page_Templates">Page Template</a>. This process isn&#8217;t too complicated once you&#8217;ve done it a couple of times, but it does require multiple steps.</p>
<p>First, copy the contents of <code>page.php</code> to a new file called <code>page-events.php</code>.</p>
<p>WordPress allows you to create as many different templates as you want for displaying pages in different manners. We&#8217;re going to use this functionality to create a template for displaying events.</p>
<p>In <code>page-events.php</code>, add the following line somewhere in the comment at the top of the file:</p>
<pre>
 		Template Name: Events Template
	</pre>
<p>This line tells WordPress that the <code>page-events.php</code> file is a Page Template and that it is named &quot;Events Template.&quot; The top part of <code>page-events.php</code> should now look something like this:</p>
<pre>
&lt;?php
/**
 * Template Name: Events Template
 * @package WordPress
 * @subpackage Twenty_Ten
 * @since Twenty Ten 1.0
 */

get_header(); ?&gt;</pre>
<p>Next, use the following code right before the beginning of the <a href="http://codex.wordpress.org/The_Loop" title="The Loop: WordPress Codex - codex.wordpress.org">WordPress Loop</a>:</p>
<pre>&lt;?php query_posts(array('post_type'=>'event')); ?&gt;
</pre>
<p>The Loop is the line that looks like this:</p>
<pre>&lt;?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?&gt;
</pre>
<p>The above code tells WordPress to find all content that has the type of event and then to loop through them.</p>
<p>Now that we have a custom page template that will display our events, we need to actually create an &quot;Events&quot; page that will display them. To do that, log back in to the WordPress admin section, create a new page with the title of Events, and then select the &quot;Events Template&quot; for the Template page attribute.</p>
<p><img src="http://images.sixrevisions.com/2010/10/06-06_wordpress_custom_post_type_events.png" width="297" height="466" alt="WordPress Custom Post Type" /></p>
<p>Now that you&#8217;ve published the Events page using the Events Template, you can go back to your site and should see the Events page. Depending on your theme, you may need to update your navigation to include this new page. If we navigate to the Events page, we see that our events are now being listed!</p>
<p><img src="http://images.sixrevisions.com/2010/10/06-07_wordpress_custom_post_type_finished.jpg" width="550" height="575" alt="WordPress Custom Post Type" /></p>
<p>Since our custom page template is listing all of the events, we can edit that template if we want to change how the listing looks. We could, for instance, add a calendar icon next to each event, only show the event title, or really customize the page in any way we wanted, just by editing the <code>page-events.php</code> file.</p>
<h3>Summary</h3>
<p>If you&#8217;ve made it this far, you now know how to create, design, display, and list custom post types in WordPress. We&#8217;ve just scratched the surface of what you can do with custom post types, but I&#8217;m sure you can see that they&#8217;re very useful for extending WordPress&#8217;s CMS capabilities.</p>
<p>If editing theme files and coding is a little too intimidating for you, there are a couple of WordPress plugins that allow you to accomplish much of the above (see <a href="http://wordpress.org/extend/plugins/custom-post-type-ui">Custom Post Type UI</a> and <a href="http://wordpress.org/extend/plugins/gd-taxonomies-tools/">GD Custom Posts And Taxonomies Tools</a>, among others).</p>
<h3>Related Content</h3>
<ul>
<li><a href="http://sixrevisions.com/wordpress/wordpress-3-0-guide/">WordPress 3.0: Ultimate Guide to New Features</a></li>
<li><a href="http://sixrevisions.com/wordpress/how-to-customize-the-wordpress-admin-area/">How to Customize the WordPress Admin Area</a></li>
<li><a href="http://sixrevisions.com/wordpress/optimizing-wordpress-for-search-engines/">Optimizing WordPress for Search Engines</a></li>
<li><em>Related categories</em>: <a href="http://sixrevisions.com/category/wordpress/">WordPress</a> and <a href="http://sixrevisions.com/category/web-development/">Web Development</a></li>
</ul>
<h3>About the Author</h3>
<p class="about-author"><img src="http://images.sixrevisions.com/authors/john_gadbois_small.jpg" alt="" width="80" height="80" /><strong>John Gadbois</strong> is a 27-year-old web developer who codes and runs Domain Superstar, a <a href="http://www.domainsuperstar.com">domain name tools</a> site. He also works on the <a href="http://www.calculatorpro.com">online calculator</a> site, CalculatorPro.com and enjoys working with WordPress, PHP, jQuery, and Ruby on Rails.</p>
]]></content:encoded>
			<wfw:commentRss>http://sixrevisions.com/wordpress/wordpress-custom-post-types-guide/feed/</wfw:commentRss>
		<slash:comments>58</slash:comments>
		</item>
	</channel>
</rss>

