<?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>Justin Tadlock &#187; WordPress Hacks</title>
	<atom:link href="http://justintadlock.com/tags/wordpress-hacks/feed" rel="self" type="application/rss+xml" />
	<link>http://justintadlock.com</link>
	<description>Life, Blogging, and WordPress</description>
	<lastBuildDate>Mon, 06 Feb 2012 18:39:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Widgetize This!</title>
		<link>http://justintadlock.com/archives/2008/04/18/widgetize-this</link>
		<comments>http://justintadlock.com/archives/2008/04/18/widgetize-this#comments</comments>
		<pubDate>Fri, 18 Apr 2008 15:45:16 +0000</pubDate>
		<dc:creator>Justin Tadlock</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Hacks]]></category>
		<category><![CDATA[WordPress Tutorials]]></category>

		<guid isPermaLink="false">http://justintadlock.com/?p=823</guid>
		<description><![CDATA[I'm about to go all WordPress Geek 2.5 on y'all now.  So, if you don't want to look at PHP code or have no clue what a widget is, then you might want to take a break from this post.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m about to go all WordPress Geek 2.5 on y&#8217;all now.  So, if you don&#8217;t want to look at PHP code or have no clue what a widget is, then you might want to take a break from this post.</p>
<h2>WordPress theme developers.  Pay attention.</h2>
<p><a href="http://themeshaper.com" title="Theme Shaper">Ian Stewart</a> just created the &#8220;<a href="http://themeshaper.com/we-need-to-kill-the-sidebar" title="We need to kill the sidebar">we need to kill the sidebar bandwagon</a>,&#8221; and it&#8217;s about time you all hopped on.</p>
<p>The basic idea is that with all the things we can do with widgets, it makes no sense to call these widgetized sections sidebars at all.  Why would we call a footer or a header widget area &#8220;Footer Sidebar&#8221; or &#8220;Header Sidebar&#8221;?  You can even <a href="http://wordpress.org/extend/ideas/topic.php?id=1384" title="WordPress ideas: Kill the sidebar"> vote on this idea</a>.</p>
<p>Since a few of you <a href="http://justintadlock.com/archives/2008/04/05/in-defense-of-the-wordpress-25-widget-panel" title="In defense of the WordPress 2.5 widget panel"> requested it</a>, I&#8217;ll give you a tutorial on how to take full advantage of WordPress 2.5&#8242;s new widget interface.</p>
<h2>The setup</h2>
<p>This is totally new code straight from the development versions of my old and new themes.</p>
<p>The first thing you need to decide is what you want to widgetize.  For the sake of this tutorial and the No Sidebar Bandwagon, let&#8217;s pretend our theme has no sidebars at all.  I&#8217;ll try to avoid using the term &#8220;sidebar&#8221; as much as possible.</p>
<p>I&#8217;m going to keep this real simple.  Here&#8217;s what our page layout will look like:</p>
<ul>
<li>Header</li>
<li>Content Area</li>
<li>Footer</li>
</ul>
<p>Each of these sections is widgetized.  Take a look at what the setup of the basic page and widget panel will look like (<em>click images for larger view</em>):</p>

<a href='http://justintadlock.com/archives/2008/04/18/widgetize-this/widget-page-layout' title='Page Layout'><img width="300" height="161" src="http://justintadlock.com/blog/wp-content/uploads/2008/04/widget-page-layout-300x161.gif" class="attachment-medium" alt="Page Layout" title="Page Layout" /></a>
<a href='http://justintadlock.com/archives/2008/04/18/widgetize-this/custom-widget-panel' title='Widget Panel'><img width="300" height="161" src="http://justintadlock.com/blog/wp-content/uploads/2008/04/custom-widget-panel-300x161.gif" class="attachment-medium" alt="Widget Panel" title="Widget Panel" /></a>

<h2>Adding widgets to the widget panel</h2>
<p>Now, we need to put together a bunch of widgetized areas for our widget panel in the WordPress dashboard.  Typically, we&#8217;ll put these in the <code> functions.php</code> file of the theme we&#8217;re using.</p>
<p>I&#8217;ve found the best way to do this, which is a lot less coding, is to create an array of all the sidebars we want to use.  Plus, it&#8217;s much cooler.</p>
<p><strong>Note:</strong> This tutorial uses text strings that are ready for localization.</p>
<pre><code>&lt;?php
/*****************************************************
Pimp out this page with an endless amount of widget sections.
*****************************************************/
if(function_exists('register_sidebar')) {

// Create widget names and put them in array
	$my_widget_name = array(
		__('Header'),
		__('Content'),
		__('Footer'),
	);

// Define how we want our widgets to display
// Replace ridiculous list items with custom style
	foreach($my_widget_name as $my_widget) :
		register_sidebar(array(
			'name' =&gt; $my_widget,
			'before_widget' =&gt; '&lt;div id="%1$s" class="widget %2$s"&gt;',
			'after_widget' =&gt; '&lt;/div&gt;',
			'before_title' =&gt; '&lt;h3 class="widget-title"&gt;',
			'after_title' =&gt; '&lt;/h3&gt;', ));
	endforeach;
} ?&gt;</code></pre>
<p>If that seemed a bit complicated, let me break the process down a bit.  We&#8217;re first creating an array of all our widgetized sections.  The reason we&#8217;re doing this is because we don&#8217;t want to have to write the second part of the code over and over and over.  So, for the second part, we just loop through each widget section and register it.</p>
<h3>Displaying your widgets on your blog</h3>
<p>I&#8217;ll show you how to display this for your header section.  It will be basically same for each of our sections.</p>
<pre><code>&lt;div id="header-widget-area"&gt;
	&lt;?php dynamic_sidebar(__('Header')); ?&gt;
&lt;/div&gt;</code></pre>
<h2>Widgetize your site!</h2>
<p>Now, you have the basic tools to widgtize your site in any way you want.  You could create widgets for any section of any page you&#8217;d like.  You could build a three-column all widget theme if you wanted.  The only limit here is your preconceptions of what widgets are and what they can do.</p>
<p>WordPress&#8217; built-in <a href="http://codex.wordpress.org/Conditional_Tags" title="WordPress conditional tags"> conditional tags</a> are your friends.  Use them.</p>
<p>If you&#8217;re using my Options theme, then I have a <a href="http://justintadlock.com/forums/topic.php?id=363" title="Endless sidebars for the Options theme"> special tutorial</a> for making many sidebars.</p>
<p>I encourage you all to start thinking about what more we can do with this.</p>
]]></content:encoded>
			<wfw:commentRss>http://justintadlock.com/archives/2008/04/18/widgetize-this/feed</wfw:commentRss>
		<slash:comments>37</slash:comments>
		</item>
		<item>
		<title>Even Simpler WordPress Contact Form</title>
		<link>http://justintadlock.com/archives/2008/02/03/even-simpler-wordpress-contact-form</link>
		<comments>http://justintadlock.com/archives/2008/02/03/even-simpler-wordpress-contact-form#comments</comments>
		<pubDate>Sun, 03 Feb 2008 20:04:10 +0000</pubDate>
		<dc:creator>Justin Tadlock</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Hacks]]></category>

		<guid isPermaLink="false">http://justintadlock.com/archives/2008/02/03/even-simpler-wordpress-contact-form</guid>
		<description><![CDATA[Are you tired of all the &#8220;bells and whistles&#8221; of most WordPress contact forms? Are you exhausted from modifying CSS for hours just to get a contact plugin to display with your theme? Try out the Simpler Contact Form for WordPress. This solution was based off my original Simple WordPress Contact Form. I&#8217;ve been using [...]]]></description>
			<content:encoded><![CDATA[<p>Are you tired of all the &#8220;bells and whistles&#8221; of most WordPress contact forms?  Are you exhausted from modifying CSS for hours just to get a contact plugin to display with your theme?</p>
<p>Try out the <strong> Simpler Contact Form</strong> for WordPress.  This solution was based off my original <a href="http://justintadlock.com/archives/2007/10/29/simplest-wordpress-contact-form" title="Simple WordPress Contact Form"> Simple WordPress Contact Form</a>.  I&#8217;ve been using this for months without any problems.</p>
<ul>
<li><strong>Description:</strong> A simple solution for all your contact form needs.  All comments left with this form are displayed in your WordPress administration panel.</li>
<li><strong>License:</strong> GPL</li>
<li><a href="http://justintadlock.com/downloads/simpler-contact-page.zip" title="Download the Simpler Contact Form for WordPress">Download (1340)</a></li>
</ul>
<h3>How does this work?</h3>
<p>Instead of downloading and testing multiple plugins and getting them to work with your theme, you simply replace your &#8220;comments.php&#8221; file with the one provided in the download.  It allows people to comment on a page called &#8220;Contact,&#8221; but instead of displaying the comments, they are hidden.  Only an administrator can view the comments from your WordPress dashboard.</p>
<p>The &#8220;comments.php&#8221; file included is a basic comments file.  It just has a few lines of code changed that check to see if the page&#8217;s name is &#8220;Contact.&#8221;</p>
<h3>Using the file on different or multiple pages</h3>
<p>To use the contact form on a page with a different name, open &#8220;comments.php&#8221; and edit this line:</p>
<pre><code>if (is_page('Contact')) {</code></pre>
<p>You would change <code> Contact</code> to the name, slug, or ID of your page.</p>
<p>To use the contact form on multiple pages, change the above code to something like this example:</p>
<pre><code>if (is_page('Contact') || is_page('About')) {</code></pre>
<p>All this does is tells the comments file to not display comments on the pages that you name.</p>
<h3>Foreseeable problems</h3>
<p>I&#8217;ve been perfectly happy using this solution for months now.  However, some bloggers might have 100s of comments every day.  This solution might not be ideal for them because the comments are displayed like regular comments in your WordPress administration panel.  So, you might have to sift through a lot of comments to see who has contacted you, unless the WordPress team puts together a better comment management system.</p>
<p>Also, if you ever change themes or your &#8220;comments.php&#8221; file, then your comments on your &#8220;Contact&#8221; page will no longer be private.  There are only two solutions to this.  You can delete each comment after you&#8217;ve read and replied to it by email or use this solution forever, even with theme changes.</p>
<h3>Final thoughts</h3>
<p>I&#8217;ve never seen this as a permanent solution to my contact form needs, but it&#8217;s worked thus far.  I&#8217;m happy with it because I never get spam since all comments are filtered through Akismet.  There&#8217;s no need for irritating CAPTCHAs.  I don&#8217;t have to edit any CSS or XHTML to get the form to display correctly.  It appears just like my normal comment form.  Plus, all my contact form comments are viewable from my WordPress dashboard.</p>
<p>This definitely isn&#8217;t the solution for everyone, but it might be worth trying out.  I thought I&#8217;d share it with you.</p>
]]></content:encoded>
			<wfw:commentRss>http://justintadlock.com/archives/2008/02/03/even-simpler-wordpress-contact-form/feed</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Simplest WordPress Contact Form</title>
		<link>http://justintadlock.com/archives/2007/10/29/simplest-wordpress-contact-form</link>
		<comments>http://justintadlock.com/archives/2007/10/29/simplest-wordpress-contact-form#comments</comments>
		<pubDate>Mon, 29 Oct 2007 21:42:57 +0000</pubDate>
		<dc:creator>Justin Tadlock</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Hacks]]></category>

		<guid isPermaLink="false">http://justintadlock.com/archives/2007/10/29/simplest-wordpress-contact-form</guid>
		<description><![CDATA[I&#8217;ve been scouring the WordPress plugin pages, other blogs, and the Web in general looking for a decent contact form that works with WordPress. Nope, not a one to be found. Well, I&#8217;m sure there is one, but I haven&#8217;t found it yet. Every plugin I found was easy to implement, but didn&#8217;t seem to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been scouring the WordPress plugin pages, other blogs, and the Web in general looking for a decent contact form that works with WordPress.  Nope, not a one to be found.</p>
<p>Well, I&#8217;m sure there is one, but I haven&#8217;t found it yet.</p>
<p>Every plugin I found was easy to implement, but didn&#8217;t seem to flow seamlessly with WordPress.  I was looking for something that would take minimal stylesheet changes, and pretty much performed like the comments form on blog posts.</p>
<p>I got everything from horribly aligned tables to plugins that had all the bells and whistles of a toddler&#8217;s Christmas morning.  I wanted simplicity, so I decided to implement an idea I had a while back.  Just use the normal comments form to allow people to contact me.</p>
<p>Basically, what I&#8217;ve done is delete a few things from the normal &#8220;comments.php,&#8221; and renamed it &#8220;contact-comments.php.&#8221;  Then, I put together a page template called Contact (contact.php).  With this technique, no comments show on the contact page, but they show in my WordPress dashboard.  You can currently see what it looks like on my <a href="http://justintadlock.com/contact" title="Contact page for justintadlock.com"> contact</a> page.</p>
<p>Before going further, I must mention that I haven&#8217;t tested this with comment plugins that pull in the latest comments or anything.  So, if you&#8217;re using something like that, I wouldn&#8217;t suggest this.  Also, this probably isn&#8217;t the ideal solution for people who get a lot of emails through their contact form every day &mdash; it could become an organization disaster.</p>
<p>If you want to use this method (although I don&#8217;t recommend it and am still looking for a decent contact plugin), the first thing you need to do is <a href="http://justintadlock.com/downloads/simple-contact-page.zip" title="Simple WordPress Contact Page"> download the Simple Contact Page (1340)</a>.  Unzip it to your &#8220;/wp-content/themes/current-theme&#8221; file.</p>
<p><img class='left i100x100' src='http://justintadlock.com/wp-content/uploads/2007/10/contact-page.gif' alt='Simple and easy contact form for WordPress: How to add a page template' /></p>
<p>Now, you need to create a WordPress page called &#8220;Contact&#8221; or &#8220;Contact Me&#8221; or whatever.  In the right sidebar you will see a drop-down list under &#8220;Page Template.&#8221;  Choose &#8220;Contact.&#8221;  At the top of the right sidebar, under &#8220;Discussion,&#8221; uncheck the box marked &#8220;Allow Pings.&#8221;  Now save your work and you&#8217;re done.</p>
<p>Easy and simple, but that&#8217;s about all you can get out of this method.  I&#8217;m sure there are some other methods we could use to separate the comments left on our contact pages, but I&#8217;m not interested in building that, unless I can&#8217;t find a decent contact plugin.</p>
<p>Yes, I should probably be spending my time working on quality content for this blog and not being lazy and posting something like this, but maybe someone would actually like to use this.</p>
<p>So, any good contact form plugins?  Something that doesn&#8217;t require a lot of work on my part?  Something that looks, feels, and plays as nice as the WordPress commenting system?</p>
]]></content:encoded>
			<wfw:commentRss>http://justintadlock.com/archives/2007/10/29/simplest-wordpress-contact-form/feed</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
	</channel>
</rss>

