<?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>WP Garage &#187; Code Snippets</title>
	<atom:link href="http://wpgarage.com/category/code-snippets/feed/" rel="self" type="application/rss+xml" />
	<link>http://wpgarage.com</link>
	<description>wordpress tricks, hacks, and tips</description>
	<lastBuildDate>Mon, 30 Aug 2010 10:34:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>How to remove the link to parent pages when using wp_list_pages in WordPress navigation</title>
		<link>http://wpgarage.com/code-snippets/how-to-remove-the-link-to-parent-pages-when-using-wp_list_pages-in-wordpress-navigation/</link>
		<comments>http://wpgarage.com/code-snippets/how-to-remove-the-link-to-parent-pages-when-using-wp_list_pages-in-wordpress-navigation/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 15:11:31 +0000</pubDate>
		<dc:creator>David Stein</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[digitalpoint]]></category>
		<category><![CDATA[Navigation bar]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://wpgarage.com/?p=810</guid>
		<description><![CDATA[Recently I was working on a client&#8217;s WordPress website and he made an interesting request, that I am actually surprised we don&#8217;t see more often. He wanted the top links on his navigation bar to not be live links, and only the sub-pages should actually link to pages on his site. In this case the [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I was working on a client&#8217;s WordPress website and he made an interesting request, that I am actually surprised we don&#8217;t see more often. He wanted the top links on his navigation bar to not be live links, and only the sub-pages should actually link to pages on his site.</p>
<p>In this case the top page on the navigation bar was called Galleries, which is the parent page for sub-pages with galleries for wedding photos, wedding videos etc. He didn&#8217;t want a main galleries page, but instead he wanted it to be a kind of folder for categorizing the various galleries he was going to have on other pages in his site.</p>
<p>Since we are using wp_list_pages, we can&#8217;t unlink each page on an individual basis since the navigation bar is dynamically formed. So I needed some way to keep using wp_list_pages so that the client can control the navigation bar, but unlink the top Galleries page.</p>
<p>I found the answer on what I think is one of the best forums around of internet and computer experts and people who are eager to help one another: <a title="Digital Point Forums" href="http://forums.digitalpoint.com/" target="_blank">Digital Point</a>.</p>
<p>After a few suggestions from people on the forums, <a title="Navigation bar links" href="http://forums.digitalpoint.com/showthread.php?t=1843887#post14451958" target="_blank">I finally got an answer</a> from the awesome <a title="bvraghav" href="http://forums.digitalpoint.com/member.php?u=432200">bvraghav</a>.</p>
<p>In the header.php section of the file I embeded a javascript code that looked like this:</p>
<pre>
<div>&lt;script type="text/javascript"&gt;
jQuery(function($) {
    $("li.page-item-283").children("a").attr('href', "javascript:void(0)");
});
&lt;/script&gt;</div>
</pre>
<p>This is how it works:</p>
<ul>
<li> The  jquery (a javascript framework) is used to replace the value of href  property in the required html node ( &lt;a  href=&#8221;your-galleries-link&#8221;&gt;&#8230;. &lt;/a&gt; in this case) with  &#8220;javascript:void(0)&#8221;.  Looks like this:  jQuery(function($) {</li>
</ul>
<ul>
<li>The following code selects the li element with: $(&#8220;li.page-item-283&#8243;). In this case 283 the page number that we want to void the link for (in our case the top Galleries page).</li>
</ul>
<ul>
<li>The next part is the  children function which selects all immediate children with tag a: children(&#8220;a&#8221;) . This relates t<span style="color: red;"><span style="color: #000000;">he child pages to the gallery pages and keeps their links. </span><br />
</span></li>
</ul>
<ul>
<li>After this I had to change the attribute href to &#8220;javascript:void(0)&#8221;, which looks like this:  .attr(&#8216;href&#8217;, &#8220;javascript:void(0)&#8221;); This turns th<span style="color: red;"><span style="color: #000000;">e gallery link into void so it won&#8217;t direct anywhere.</span><br />
</span></li>
</ul>
<p>All this comes together to look like the code above.</p>
<p>If you want to make all top level links unlinked, use the following code:</p>
<pre>&lt;script type="text/javascript"&gt;
jQuery(function($) {    
    $("li.page_item").children("a").attr('href', "javascript:void(0)"); });
&lt;/script&gt;</pre>
<p>What I&#8217;m wondering is if the new WordPress navigation system allows users to include items in navigation bars that don&#8217;t actually lead anywhere. Anyone know?</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://wpgarage.com/code-snippets/how-to-remove-the-link-to-parent-pages-when-using-wp_list_pages-in-wordpress-navigation/&amp;title=How+to+remove+the+link+to+parent+pages+when+using+wp_list_pages+in+WordPress+navigation" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://wpgarage.com/code-snippets/how-to-remove-the-link-to-parent-pages-when-using-wp_list_pages-in-wordpress-navigation/&amp;title=How+to+remove+the+link+to+parent+pages+when+using+wp_list_pages+in+WordPress+navigation" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://wpgarage.com/code-snippets/how-to-remove-the-link-to-parent-pages-when-using-wp_list_pages-in-wordpress-navigation/&amp;title=How+to+remove+the+link+to+parent+pages+when+using+wp_list_pages+in+WordPress+navigation&amp;desc=Recently%20I%20was%20working%20on%20a%20client%27s%20WordPress%20website%20and%20he%20made%20an%20interesting%20request%2C%20that%20I%20am%20actually%20surprised%20we%20don%27t%20see%20more%20often.%20He%20wanted%20the%20top%20links%20on%20his%20navigation%20bar%20to%20not%20be%20live%20links%2C%20and%20only%20the%20sub-pages%20should%20actually%20link%20to%20pages%20on%20his%20site.%0D%0A%0D%0AIn%20this%20case%20the%20t" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://wpgarage.com/code-snippets/how-to-remove-the-link-to-parent-pages-when-using-wp_list_pages-in-wordpress-navigation/&amp;t=How+to+remove+the+link+to+parent+pages+when+using+wp_list_pages+in+WordPress+navigation" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-friendfeed">
			<a href="http://www.friendfeed.com/share?title=How+to+remove+the+link+to+parent+pages+when+using+wp_list_pages+in+WordPress+navigation&amp;link=http://wpgarage.com/code-snippets/how-to-remove-the-link-to-parent-pages-when-using-wp_list_pages-in-wordpress-navigation/" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="shr-gmail">
			<a href="https://mail.google.com/mail/?ui=2&amp;view=cm&amp;fs=1&amp;tf=1&amp;su=How+to+remove+the+link+to+parent+pages+when+using+wp_list_pages+in+WordPress+navigation&amp;body=Link: http://wpgarage.com/code-snippets/how-to-remove-the-link-to-parent-pages-when-using-wp_list_pages-in-wordpress-navigation/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A Recently%20I%20was%20working%20on%20a%20client%27s%20WordPress%20website%20and%20he%20made%20an%20interesting%20request%2C%20that%20I%20am%20actually%20surprised%20we%20don%27t%20see%20more%20often.%20He%20wanted%20the%20top%20links%20on%20his%20navigation%20bar%20to%20not%20be%20live%20links%2C%20and%20only%20the%20sub-pages%20should%20actually%20link%20to%20pages%20on%20his%20site.%0D%0A%0D%0AIn%20this%20case%20the%20t" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://wpgarage.com/code-snippets/how-to-remove-the-link-to-parent-pages-when-using-wp_list_pages-in-wordpress-navigation/&amp;title=How+to+remove+the+link+to+parent+pages+when+using+wp_list_pages+in+WordPress+navigation" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://wpgarage.com/code-snippets/how-to-remove-the-link-to-parent-pages-when-using-wp_list_pages-in-wordpress-navigation/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-googlereader">
			<a href="http://www.google.com/reader/link?url=http://wpgarage.com/code-snippets/how-to-remove-the-link-to-parent-pages-when-using-wp_list_pages-in-wordpress-navigation/&amp;title=How+to+remove+the+link+to+parent+pages+when+using+wp_list_pages+in+WordPress+navigation&amp;srcUrl=http://wpgarage.com/code-snippets/how-to-remove-the-link-to-parent-pages-when-using-wp_list_pages-in-wordpress-navigation/&amp;srcTitle=How+to+remove+the+link+to+parent+pages+when+using+wp_list_pages+in+WordPress+navigation&amp;snippet=Recently%20I%20was%20working%20on%20a%20client%27s%20WordPress%20website%20and%20he%20made%20an%20interesting%20request%2C%20that%20I%20am%20actually%20surprised%20we%20don%27t%20see%20more%20often.%20He%20wanted%20the%20top%20links%20on%20his%20navigation%20bar%20to%20not%20be%20live%20links%2C%20and%20only%20the%20sub-pages%20should%20actually%20link%20to%20pages%20on%20his%20site.%0D%0A%0D%0AIn%20this%20case%20the%20t" rel="nofollow" class="external" title="Add this to Google Reader">Add this to Google Reader</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://wpgarage.com/code-snippets/how-to-remove-the-link-to-parent-pages-when-using-wp_list_pages-in-wordpress-navigation/&amp;title=How+to+remove+the+link+to+parent+pages+when+using+wp_list_pages+in+WordPress+navigation&amp;summary=Recently%20I%20was%20working%20on%20a%20client%27s%20WordPress%20website%20and%20he%20made%20an%20interesting%20request%2C%20that%20I%20am%20actually%20surprised%20we%20don%27t%20see%20more%20often.%20He%20wanted%20the%20top%20links%20on%20his%20navigation%20bar%20to%20not%20be%20live%20links%2C%20and%20only%20the%20sub-pages%20should%20actually%20link%20to%20pages%20on%20his%20site.%0D%0A%0D%0AIn%20this%20case%20the%20t&amp;source=WP Garage" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-netvibes">
			<a href="http://www.netvibes.com/share?title=How+to+remove+the+link+to+parent+pages+when+using+wp_list_pages+in+WordPress+navigation&amp;url=http://wpgarage.com/code-snippets/how-to-remove-the-link-to-parent-pages-when-using-wp_list_pages-in-wordpress-navigation/" rel="nofollow" class="external" title="Submit this to Netvibes">Submit this to Netvibes</a>
		</li>
		<li class="shr-posterous">
			<a href="http://posterous.com/share?linkto=http://wpgarage.com/code-snippets/how-to-remove-the-link-to-parent-pages-when-using-wp_list_pages-in-wordpress-navigation/&amp;title=How+to+remove+the+link+to+parent+pages+when+using+wp_list_pages+in+WordPress+navigation&amp;selection=Recently%20I%20was%20working%20on%20a%20client%27s%20WordPress%20website%20and%20he%20made%20an%20interesting%20request%2C%20that%20I%20am%20actually%20surprised%20we%20don%27t%20see%20more%20often.%20He%20wanted%20the%20top%20links%20on%20his%20navigation%20bar%20to%20not%20be%20live%20links%2C%20and%20only%20the%20sub-pages%20should%20actually%20link%20to%20pages%20on%20his%20site.%0D%0A%0D%0AIn%20this%20case%20the%20t" rel="nofollow" class="external" title="Post this to Posterous">Post this to Posterous</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://wpgarage.com/code-snippets/how-to-remove-the-link-to-parent-pages-when-using-wp_list_pages-in-wordpress-navigation/&amp;title=How+to+remove+the+link+to+parent+pages+when+using+wp_list_pages+in+WordPress+navigation" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-slashdot">
			<a href="http://slashdot.org/bookmark.pl?url=http://wpgarage.com/code-snippets/how-to-remove-the-link-to-parent-pages-when-using-wp_list_pages-in-wordpress-navigation/&amp;title=How+to+remove+the+link+to+parent+pages+when+using+wp_list_pages+in+WordPress+navigation" rel="nofollow" class="external" title="Submit this to SlashDot">Submit this to SlashDot</a>
		</li>
		<li class="shr-sphinn">
			<a href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http://wpgarage.com/code-snippets/how-to-remove-the-link-to-parent-pages-when-using-wp_list_pages-in-wordpress-navigation/" rel="nofollow" class="external" title="Sphinn this on Sphinn">Sphinn this on Sphinn</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://wpgarage.com/code-snippets/how-to-remove-the-link-to-parent-pages-when-using-wp_list_pages-in-wordpress-navigation/&amp;title=How+to+remove+the+link+to+parent+pages+when+using+wp_list_pages+in+WordPress+navigation" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-techmeme">
			<a href="http://twitter.com/home/?status=Tip+@Techmeme+http://wpgarage.com/code-snippets/how-to-remove-the-link-to-parent-pages-when-using-wp_list_pages-in-wordpress-navigation/+&quot;How+to+remove+the+link+to+parent+pages+when+using+wp_list_pages+in+WordPress+navigation&quot;&amp;source=shareaholic" rel="nofollow" class="external" title="Tip this to TechMeme">Tip this to TechMeme</a>
		</li>
		<li class="shr-tumblr">
			<a href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fwpgarage.com%2Fcode-snippets%2Fhow-to-remove-the-link-to-parent-pages-when-using-wp_list_pages-in-wordpress-navigation%2F&amp;t=How+to+remove+the+link+to+parent+pages+when+using+wp_list_pages+in+WordPress+navigation" rel="nofollow" class="external" title="Share this on Tumblr">Share this on Tumblr</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=How+to+remove+the+link+to+parent+pages+when+using+wp_list_pages+in+WordPress+nav%5B..%5D+-++%28via+%40wpgarage%29&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22How%20to%20remove%20the%20link%20to%20parent%20pages%20when%20using%20wp_list_pages%20in%20WordPress%20navigation%22&amp;body=Link: http://wpgarage.com/code-snippets/how-to-remove-the-link-to-parent-pages-when-using-wp_list_pages-in-wordpress-navigation/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A Recently%20I%20was%20working%20on%20a%20client%27s%20WordPress%20website%20and%20he%20made%20an%20interesting%20request%2C%20that%20I%20am%20actually%20surprised%20we%20don%27t%20see%20more%20often.%20He%20wanted%20the%20top%20links%20on%20his%20navigation%20bar%20to%20not%20be%20live%20links%2C%20and%20only%20the%20sub-pages%20should%20actually%20link%20to%20pages%20on%20his%20site.%0D%0A%0D%0AIn%20this%20case%20the%20t" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
		<li class="shr-printfriendly">
			<a href="http://www.printfriendly.com/print?url=http://wpgarage.com/code-snippets/how-to-remove-the-link-to-parent-pages-when-using-wp_list_pages-in-wordpress-navigation/" rel="nofollow" class="external" title="Send this page to Print Friendly">Send this page to Print Friendly</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://wpgarage.com/code-snippets/how-to-remove-the-link-to-parent-pages-when-using-wp_list_pages-in-wordpress-navigation/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Automatic Plugin Upgrade broken after WordPress 2.9.2 and some fixes</title>
		<link>http://wpgarage.com/code-snippets/automatic-plugin-upgrade-broken-after-wordpress-2-9-2-and-some-fixes/</link>
		<comments>http://wpgarage.com/code-snippets/automatic-plugin-upgrade-broken-after-wordpress-2-9-2-and-some-fixes/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 06:43:25 +0000</pubDate>
		<dc:creator>Rebecca Markowitz</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[automatic upgrade]]></category>
		<category><![CDATA[find content directory]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[remove old plugin]]></category>

		<guid isPermaLink="false">http://wpgarage.com/?p=712</guid>
		<description><![CDATA[After manually upgrading one of our client&#8217;s sites to WordPress 2.9.2. we noticed that the only thing that went awry was the automatic plugin upgrade. WP asked me for the FTP information, and then gave me this error message: Cannot find Content directory (WP-Content) The first solution I found suggested to make sure that all [...]]]></description>
			<content:encoded><![CDATA[<div>
<div>
<p>After manually upgrading one of our client&#8217;s sites to WordPress 2.9.2. we noticed that the only thing that went awry was the automatic plugin upgrade.</p>
<p>WP asked me for the FTP information, and then gave me this error message:</p>
<p><strong>Cannot find Content directory (WP-Content)</strong></p>
<p>The first solution I found suggested to make sure that all the necessary folders and files had a permission level of 755 or 777 (wp-content folder, plugin folder, upgrade folder) and to  add the following to the wp-config file as indicated by<a href="http://www.hui-wang.info/2009/06/unable-to-locate-wordpress-content-directory-wp-content/"> Hui Wang</a>:</p>
<div>
<div>
<blockquote><p>if(is_admin()) {<br />
add_filter(&#8216;filesystem_method&#8217;, create_function(&#8216;$a&#8217;, &#8216;return &#8220;direct&#8221;;&#8217; ));<br />
define( &#8216;FS_CHMOD_DIR&#8217;, 0751 );<br />
}</p></blockquote>
</div>
</div>
<p>But,  this caused the plugin list to show duplicate plugins &#8211; the older version and the upgraded version of the plugin. For some reason, it wasn&#8217;t deleting the old files.</p>
<p>Then, I tried deleting the code from the wp-config and trying again.  This time, I got a different error (don&#8217;t ask me why):</p>
<p><strong>Could not remove the old plugin</strong></p>
<p><strong>Plugin upgrade Failed</strong></p>
<p>So I found this<a href="http://wordpress.org/support/topic/266008"> fix from the Support Forum</a><strong> </strong>which seems to have fixed everything for now. <strong> </strong></p>
<div>
<div>
<div>
<div>
<blockquote><p>1. Make sure your wp-config.php file is chmodded to 0644.</p>
<p>2. Also make sure your .htaccess file is protecting the wp-config file using these lines:</p>
<p>&lt;Files wp-config.php&gt;<br />
order allow,deny<br />
deny from all<br />
&lt;/Files&gt;</p>
<p>3. Backup your wp-config.php file.</p>
<p>4. Edit your wp-config.php file putting these lines in underneath &lt;?php:</p>
<p>define(&#8216;FS_METHOD&#8217;, &#8216;ftpsockets&#8217;);<br />
define(&#8216;FTP_BASE&#8217;, &#8216;/path/to/wordpress/&#8217;);<br />
define(&#8216;FTP_CONTENT_DIR&#8217;, &#8216;/path/to/wordpress/wp-content/&#8217;);<br />
define(&#8216;FTP_PLUGIN_DIR &#8216;, &#8216;/path/to/wordpress/wp-content/plugins/&#8217;);<br />
define(&#8216;FTP_USER&#8217;, &#8216;username&#8217;);<br />
define(&#8216;FTP_PASS&#8217;, &#8216;password&#8217;);<br />
define(&#8216;FTP_HOST&#8217;, &#8216;<a href="http://ftp.example.org/" target="_blank">ftp.example.org</a>&#8216;);</p></blockquote>
<p>Crossing our fingers that the automatic upgrade to version 3.0 will go smoothly!</p>
</div>
</div>
</div>
</div>
</div>
</div>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://wpgarage.com/code-snippets/automatic-plugin-upgrade-broken-after-wordpress-2-9-2-and-some-fixes/&amp;title=Automatic+Plugin+Upgrade+broken+after+WordPress+2.9.2+and+some+fixes" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://wpgarage.com/code-snippets/automatic-plugin-upgrade-broken-after-wordpress-2-9-2-and-some-fixes/&amp;title=Automatic+Plugin+Upgrade+broken+after+WordPress+2.9.2+and+some+fixes" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://wpgarage.com/code-snippets/automatic-plugin-upgrade-broken-after-wordpress-2-9-2-and-some-fixes/&amp;title=Automatic+Plugin+Upgrade+broken+after+WordPress+2.9.2+and+some+fixes&amp;desc=%0D%0A%0D%0A%0D%0AAfter%20manually%20upgrading%20one%20of%20our%20client%27s%20sites%20to%20WordPress%202.9.2.%20we%20noticed%20that%20the%20only%20thing%20that%20went%20awry%20was%20the%20automatic%20plugin%20upgrade.%0D%0A%0D%0AWP%20asked%20me%20for%20the%20FTP%20information%2C%20and%20then%20gave%20me%20this%20error%20message%3A%0D%0A%0D%0ACannot%20find%20Content%20directory%20%28WP-Content%29%0D%0A%0D%0AThe%20first%20solutio" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://wpgarage.com/code-snippets/automatic-plugin-upgrade-broken-after-wordpress-2-9-2-and-some-fixes/&amp;t=Automatic+Plugin+Upgrade+broken+after+WordPress+2.9.2+and+some+fixes" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-friendfeed">
			<a href="http://www.friendfeed.com/share?title=Automatic+Plugin+Upgrade+broken+after+WordPress+2.9.2+and+some+fixes&amp;link=http://wpgarage.com/code-snippets/automatic-plugin-upgrade-broken-after-wordpress-2-9-2-and-some-fixes/" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="shr-gmail">
			<a href="https://mail.google.com/mail/?ui=2&amp;view=cm&amp;fs=1&amp;tf=1&amp;su=Automatic+Plugin+Upgrade+broken+after+WordPress+2.9.2+and+some+fixes&amp;body=Link: http://wpgarage.com/code-snippets/automatic-plugin-upgrade-broken-after-wordpress-2-9-2-and-some-fixes/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A %0D%0A%0D%0A%0D%0AAfter%20manually%20upgrading%20one%20of%20our%20client%27s%20sites%20to%20WordPress%202.9.2.%20we%20noticed%20that%20the%20only%20thing%20that%20went%20awry%20was%20the%20automatic%20plugin%20upgrade.%0D%0A%0D%0AWP%20asked%20me%20for%20the%20FTP%20information%2C%20and%20then%20gave%20me%20this%20error%20message%3A%0D%0A%0D%0ACannot%20find%20Content%20directory%20%28WP-Content%29%0D%0A%0D%0AThe%20first%20solutio" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://wpgarage.com/code-snippets/automatic-plugin-upgrade-broken-after-wordpress-2-9-2-and-some-fixes/&amp;title=Automatic+Plugin+Upgrade+broken+after+WordPress+2.9.2+and+some+fixes" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://wpgarage.com/code-snippets/automatic-plugin-upgrade-broken-after-wordpress-2-9-2-and-some-fixes/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-googlereader">
			<a href="http://www.google.com/reader/link?url=http://wpgarage.com/code-snippets/automatic-plugin-upgrade-broken-after-wordpress-2-9-2-and-some-fixes/&amp;title=Automatic+Plugin+Upgrade+broken+after+WordPress+2.9.2+and+some+fixes&amp;srcUrl=http://wpgarage.com/code-snippets/automatic-plugin-upgrade-broken-after-wordpress-2-9-2-and-some-fixes/&amp;srcTitle=Automatic+Plugin+Upgrade+broken+after+WordPress+2.9.2+and+some+fixes&amp;snippet=%0D%0A%0D%0A%0D%0AAfter%20manually%20upgrading%20one%20of%20our%20client%27s%20sites%20to%20WordPress%202.9.2.%20we%20noticed%20that%20the%20only%20thing%20that%20went%20awry%20was%20the%20automatic%20plugin%20upgrade.%0D%0A%0D%0AWP%20asked%20me%20for%20the%20FTP%20information%2C%20and%20then%20gave%20me%20this%20error%20message%3A%0D%0A%0D%0ACannot%20find%20Content%20directory%20%28WP-Content%29%0D%0A%0D%0AThe%20first%20solutio" rel="nofollow" class="external" title="Add this to Google Reader">Add this to Google Reader</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://wpgarage.com/code-snippets/automatic-plugin-upgrade-broken-after-wordpress-2-9-2-and-some-fixes/&amp;title=Automatic+Plugin+Upgrade+broken+after+WordPress+2.9.2+and+some+fixes&amp;summary=%0D%0A%0D%0A%0D%0AAfter%20manually%20upgrading%20one%20of%20our%20client%27s%20sites%20to%20WordPress%202.9.2.%20we%20noticed%20that%20the%20only%20thing%20that%20went%20awry%20was%20the%20automatic%20plugin%20upgrade.%0D%0A%0D%0AWP%20asked%20me%20for%20the%20FTP%20information%2C%20and%20then%20gave%20me%20this%20error%20message%3A%0D%0A%0D%0ACannot%20find%20Content%20directory%20%28WP-Content%29%0D%0A%0D%0AThe%20first%20solutio&amp;source=WP Garage" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-netvibes">
			<a href="http://www.netvibes.com/share?title=Automatic+Plugin+Upgrade+broken+after+WordPress+2.9.2+and+some+fixes&amp;url=http://wpgarage.com/code-snippets/automatic-plugin-upgrade-broken-after-wordpress-2-9-2-and-some-fixes/" rel="nofollow" class="external" title="Submit this to Netvibes">Submit this to Netvibes</a>
		</li>
		<li class="shr-posterous">
			<a href="http://posterous.com/share?linkto=http://wpgarage.com/code-snippets/automatic-plugin-upgrade-broken-after-wordpress-2-9-2-and-some-fixes/&amp;title=Automatic+Plugin+Upgrade+broken+after+WordPress+2.9.2+and+some+fixes&amp;selection=%0D%0A%0D%0A%0D%0AAfter%20manually%20upgrading%20one%20of%20our%20client%27s%20sites%20to%20WordPress%202.9.2.%20we%20noticed%20that%20the%20only%20thing%20that%20went%20awry%20was%20the%20automatic%20plugin%20upgrade.%0D%0A%0D%0AWP%20asked%20me%20for%20the%20FTP%20information%2C%20and%20then%20gave%20me%20this%20error%20message%3A%0D%0A%0D%0ACannot%20find%20Content%20directory%20%28WP-Content%29%0D%0A%0D%0AThe%20first%20solutio" rel="nofollow" class="external" title="Post this to Posterous">Post this to Posterous</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://wpgarage.com/code-snippets/automatic-plugin-upgrade-broken-after-wordpress-2-9-2-and-some-fixes/&amp;title=Automatic+Plugin+Upgrade+broken+after+WordPress+2.9.2+and+some+fixes" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-slashdot">
			<a href="http://slashdot.org/bookmark.pl?url=http://wpgarage.com/code-snippets/automatic-plugin-upgrade-broken-after-wordpress-2-9-2-and-some-fixes/&amp;title=Automatic+Plugin+Upgrade+broken+after+WordPress+2.9.2+and+some+fixes" rel="nofollow" class="external" title="Submit this to SlashDot">Submit this to SlashDot</a>
		</li>
		<li class="shr-sphinn">
			<a href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http://wpgarage.com/code-snippets/automatic-plugin-upgrade-broken-after-wordpress-2-9-2-and-some-fixes/" rel="nofollow" class="external" title="Sphinn this on Sphinn">Sphinn this on Sphinn</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://wpgarage.com/code-snippets/automatic-plugin-upgrade-broken-after-wordpress-2-9-2-and-some-fixes/&amp;title=Automatic+Plugin+Upgrade+broken+after+WordPress+2.9.2+and+some+fixes" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-techmeme">
			<a href="http://twitter.com/home/?status=Tip+@Techmeme+http://wpgarage.com/code-snippets/automatic-plugin-upgrade-broken-after-wordpress-2-9-2-and-some-fixes/+&quot;Automatic+Plugin+Upgrade+broken+after+WordPress+2.9.2+and+some+fixes&quot;&amp;source=shareaholic" rel="nofollow" class="external" title="Tip this to TechMeme">Tip this to TechMeme</a>
		</li>
		<li class="shr-tumblr">
			<a href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fwpgarage.com%2Fcode-snippets%2Fautomatic-plugin-upgrade-broken-after-wordpress-2-9-2-and-some-fixes%2F&amp;t=Automatic+Plugin+Upgrade+broken+after+WordPress+2.9.2+and+some+fixes" rel="nofollow" class="external" title="Share this on Tumblr">Share this on Tumblr</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Automatic+Plugin+Upgrade+broken+after+WordPress+2.9.2+and+some+fixes+-++%28via+%40wpgarage%29&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22Automatic%20Plugin%20Upgrade%20broken%20after%20WordPress%202.9.2%20and%20some%20fixes%22&amp;body=Link: http://wpgarage.com/code-snippets/automatic-plugin-upgrade-broken-after-wordpress-2-9-2-and-some-fixes/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A %0D%0A%0D%0A%0D%0AAfter%20manually%20upgrading%20one%20of%20our%20client%27s%20sites%20to%20WordPress%202.9.2.%20we%20noticed%20that%20the%20only%20thing%20that%20went%20awry%20was%20the%20automatic%20plugin%20upgrade.%0D%0A%0D%0AWP%20asked%20me%20for%20the%20FTP%20information%2C%20and%20then%20gave%20me%20this%20error%20message%3A%0D%0A%0D%0ACannot%20find%20Content%20directory%20%28WP-Content%29%0D%0A%0D%0AThe%20first%20solutio" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
		<li class="shr-printfriendly">
			<a href="http://www.printfriendly.com/print?url=http://wpgarage.com/code-snippets/automatic-plugin-upgrade-broken-after-wordpress-2-9-2-and-some-fixes/" rel="nofollow" class="external" title="Send this page to Print Friendly">Send this page to Print Friendly</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://wpgarage.com/code-snippets/automatic-plugin-upgrade-broken-after-wordpress-2-9-2-and-some-fixes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to create an archive based on custom fields, not publish date in WordPress</title>
		<link>http://wpgarage.com/code-snippets/how-to-create-an-archive-based-on-custom-fields-not-publish-date-in-wordpress/</link>
		<comments>http://wpgarage.com/code-snippets/how-to-create-an-archive-based-on-custom-fields-not-publish-date-in-wordpress/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 13:06:11 +0000</pubDate>
		<dc:creator>Rebecca Markowitz</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[archives]]></category>
		<category><![CDATA[custom field]]></category>
		<category><![CDATA[dates]]></category>
		<category><![CDATA[events]]></category>
		<category><![CDATA[publish dates]]></category>

		<guid isPermaLink="false">http://wpgarage.com/?p=699</guid>
		<description><![CDATA[We recently launched a site called theforgottenletters.org, an incredible project dedicated to translating the Holocaust-era letters of Ralph Schwab from German to English. While building the site, we needed to archive the letters based on the dates the letters were written, not when we publish them to the site. First, I tried this tutorial: How [...]]]></description>
			<content:encoded><![CDATA[<p>We recently launched a site called <a href="http://theforgottenletters.org">theforgottenletters.org</a>, an incredible project dedicated to translating the Holocaust-era letters of Ralph Schwab from German to English. While building the site, we needed to archive the letters based on the dates the letters were written, not when we publish them to the site.</p>
<p>First, I tried this <a href="http://www.problogdesign.com/wordpress/how-to-make-a-wordpress-events-list/">tu</a><a href="http://www.problogdesign.com/wordpress/how-to-make-a-wordpress-events-list/">torial: How To Make a WordPress Events List</a> and <a href="http://wpgarage.com/plugins/wordpress-calendar-plugins/">calendar plugins</a>, but the tutorial wasn&#8217;t comprehensive enough and the plugins were too complex to start messing with.</p>
<p><strong>The solution</strong></p>
<p>I found this wonderful <a href="http://matth.eu/wordpress-date-field-plugin">date field plugin</a> which lets  you sort posts by the date entered in the custom fields.  Here&#8217;s what I did:</p>
<p>1. Upload the plugin and activate it</p>
<p>2. Opened the lettersarchive.php page template I created and added a query. The query checks for posts in the Letters category that have a date filled in and the orders it from oldest to newest.</p>
<p><strong>&lt;?php query_posts(&#8216;category_name=letters&amp;meta_key=date_value&amp;orderby=meta_value&amp;order=DESC&#8217;); ?&gt;</strong></p>
<p>3. I replaced a typical date function within the loop &lt;?php the_time(&#8216;j M Y&#8217;); ?&gt; with</p>
<p><strong>&lt;?php echo date(&#8220;l jS \of F Y&#8221;, get_post_meta($post-&gt;ID, &#8216;date_value&#8217;, true));?&gt;</strong></p>
<p>4. I created a new post,  assigned it to the Letters category, and selected a date from the date picker box that now appears below the editing box in the post area.<br />
<img class="alignnone size-full wp-image-701" title="adddateinfo" src="http://wpgarage.com/wp-content/uploads/2010/04/adddateinfo.png" alt="" width="309" height="120" /></p>
<p>I noticed that the Date Field plugin only lets you select a date up to 5 years ago  so I had to hack the plugin file on line 125 to  reflect selecting dates from 80 years ago.</p>
<p>for($currentyear = date(&#8216;Y&#8217;)<strong> &#8211; 80</strong>; $currentyear &lt;= date(Y) +5;$currentyear +=1)</p>
<p>Here&#8217;s a screenshot of the archive from <a href="http://theforgottenletters.org">The Forgotten Letters</a> site.</p>
<p><img class="alignnone size-full wp-image-702" title="lettersscreen" src="http://wpgarage.com/wp-content/uploads/2010/04/lettersscreen.png" alt="" width="250" height="191" /></p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">http://www.problogdesign.com/wordpress/how-to-make-a-wordpress-events-list/#comment-16409</div>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://wpgarage.com/code-snippets/how-to-create-an-archive-based-on-custom-fields-not-publish-date-in-wordpress/&amp;title=How+to+create+an+archive+based+on+custom+fields%2C+not+publish+date+in+WordPress" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://wpgarage.com/code-snippets/how-to-create-an-archive-based-on-custom-fields-not-publish-date-in-wordpress/&amp;title=How+to+create+an+archive+based+on+custom+fields%2C+not+publish+date+in+WordPress" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://wpgarage.com/code-snippets/how-to-create-an-archive-based-on-custom-fields-not-publish-date-in-wordpress/&amp;title=How+to+create+an+archive+based+on+custom+fields%2C+not+publish+date+in+WordPress&amp;desc=We%20recently%20launched%20a%20site%20called%20theforgottenletters.org%2C%20an%20incredible%20project%20dedicated%20to%20translating%20the%20Holocaust-era%20letters%20of%20Ralph%20Schwab%20from%20German%20to%20English.%20While%20building%20the%20site%2C%20we%20needed%20to%20archive%20the%20letters%20based%20on%20the%20dates%20the%20letters%20were%20written%2C%20not%20when%20we%20publish%20them" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://wpgarage.com/code-snippets/how-to-create-an-archive-based-on-custom-fields-not-publish-date-in-wordpress/&amp;t=How+to+create+an+archive+based+on+custom+fields%2C+not+publish+date+in+WordPress" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-friendfeed">
			<a href="http://www.friendfeed.com/share?title=How+to+create+an+archive+based+on+custom+fields%2C+not+publish+date+in+WordPress&amp;link=http://wpgarage.com/code-snippets/how-to-create-an-archive-based-on-custom-fields-not-publish-date-in-wordpress/" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="shr-gmail">
			<a href="https://mail.google.com/mail/?ui=2&amp;view=cm&amp;fs=1&amp;tf=1&amp;su=How+to+create+an+archive+based+on+custom+fields%2C+not+publish+date+in+WordPress&amp;body=Link: http://wpgarage.com/code-snippets/how-to-create-an-archive-based-on-custom-fields-not-publish-date-in-wordpress/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A We%20recently%20launched%20a%20site%20called%20theforgottenletters.org%2C%20an%20incredible%20project%20dedicated%20to%20translating%20the%20Holocaust-era%20letters%20of%20Ralph%20Schwab%20from%20German%20to%20English.%20While%20building%20the%20site%2C%20we%20needed%20to%20archive%20the%20letters%20based%20on%20the%20dates%20the%20letters%20were%20written%2C%20not%20when%20we%20publish%20them" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://wpgarage.com/code-snippets/how-to-create-an-archive-based-on-custom-fields-not-publish-date-in-wordpress/&amp;title=How+to+create+an+archive+based+on+custom+fields%2C+not+publish+date+in+WordPress" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://wpgarage.com/code-snippets/how-to-create-an-archive-based-on-custom-fields-not-publish-date-in-wordpress/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-googlereader">
			<a href="http://www.google.com/reader/link?url=http://wpgarage.com/code-snippets/how-to-create-an-archive-based-on-custom-fields-not-publish-date-in-wordpress/&amp;title=How+to+create+an+archive+based+on+custom+fields%2C+not+publish+date+in+WordPress&amp;srcUrl=http://wpgarage.com/code-snippets/how-to-create-an-archive-based-on-custom-fields-not-publish-date-in-wordpress/&amp;srcTitle=How+to+create+an+archive+based+on+custom+fields%2C+not+publish+date+in+WordPress&amp;snippet=We%20recently%20launched%20a%20site%20called%20theforgottenletters.org%2C%20an%20incredible%20project%20dedicated%20to%20translating%20the%20Holocaust-era%20letters%20of%20Ralph%20Schwab%20from%20German%20to%20English.%20While%20building%20the%20site%2C%20we%20needed%20to%20archive%20the%20letters%20based%20on%20the%20dates%20the%20letters%20were%20written%2C%20not%20when%20we%20publish%20them" rel="nofollow" class="external" title="Add this to Google Reader">Add this to Google Reader</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://wpgarage.com/code-snippets/how-to-create-an-archive-based-on-custom-fields-not-publish-date-in-wordpress/&amp;title=How+to+create+an+archive+based+on+custom+fields%2C+not+publish+date+in+WordPress&amp;summary=We%20recently%20launched%20a%20site%20called%20theforgottenletters.org%2C%20an%20incredible%20project%20dedicated%20to%20translating%20the%20Holocaust-era%20letters%20of%20Ralph%20Schwab%20from%20German%20to%20English.%20While%20building%20the%20site%2C%20we%20needed%20to%20archive%20the%20letters%20based%20on%20the%20dates%20the%20letters%20were%20written%2C%20not%20when%20we%20publish%20them&amp;source=WP Garage" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-netvibes">
			<a href="http://www.netvibes.com/share?title=How+to+create+an+archive+based+on+custom+fields%2C+not+publish+date+in+WordPress&amp;url=http://wpgarage.com/code-snippets/how-to-create-an-archive-based-on-custom-fields-not-publish-date-in-wordpress/" rel="nofollow" class="external" title="Submit this to Netvibes">Submit this to Netvibes</a>
		</li>
		<li class="shr-posterous">
			<a href="http://posterous.com/share?linkto=http://wpgarage.com/code-snippets/how-to-create-an-archive-based-on-custom-fields-not-publish-date-in-wordpress/&amp;title=How+to+create+an+archive+based+on+custom+fields%2C+not+publish+date+in+WordPress&amp;selection=We%20recently%20launched%20a%20site%20called%20theforgottenletters.org%2C%20an%20incredible%20project%20dedicated%20to%20translating%20the%20Holocaust-era%20letters%20of%20Ralph%20Schwab%20from%20German%20to%20English.%20While%20building%20the%20site%2C%20we%20needed%20to%20archive%20the%20letters%20based%20on%20the%20dates%20the%20letters%20were%20written%2C%20not%20when%20we%20publish%20them" rel="nofollow" class="external" title="Post this to Posterous">Post this to Posterous</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://wpgarage.com/code-snippets/how-to-create-an-archive-based-on-custom-fields-not-publish-date-in-wordpress/&amp;title=How+to+create+an+archive+based+on+custom+fields%2C+not+publish+date+in+WordPress" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-slashdot">
			<a href="http://slashdot.org/bookmark.pl?url=http://wpgarage.com/code-snippets/how-to-create-an-archive-based-on-custom-fields-not-publish-date-in-wordpress/&amp;title=How+to+create+an+archive+based+on+custom+fields%2C+not+publish+date+in+WordPress" rel="nofollow" class="external" title="Submit this to SlashDot">Submit this to SlashDot</a>
		</li>
		<li class="shr-sphinn">
			<a href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http://wpgarage.com/code-snippets/how-to-create-an-archive-based-on-custom-fields-not-publish-date-in-wordpress/" rel="nofollow" class="external" title="Sphinn this on Sphinn">Sphinn this on Sphinn</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://wpgarage.com/code-snippets/how-to-create-an-archive-based-on-custom-fields-not-publish-date-in-wordpress/&amp;title=How+to+create+an+archive+based+on+custom+fields%2C+not+publish+date+in+WordPress" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-techmeme">
			<a href="http://twitter.com/home/?status=Tip+@Techmeme+http://wpgarage.com/code-snippets/how-to-create-an-archive-based-on-custom-fields-not-publish-date-in-wordpress/+&quot;How+to+create+an+archive+based+on+custom+fields%2C+not+publish+date+in+WordPress&quot;&amp;source=shareaholic" rel="nofollow" class="external" title="Tip this to TechMeme">Tip this to TechMeme</a>
		</li>
		<li class="shr-tumblr">
			<a href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fwpgarage.com%2Fcode-snippets%2Fhow-to-create-an-archive-based-on-custom-fields-not-publish-date-in-wordpress%2F&amp;t=How+to+create+an+archive+based+on+custom+fields%2C+not+publish+date+in+WordPress" rel="nofollow" class="external" title="Share this on Tumblr">Share this on Tumblr</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=How+to+create+an+archive+based+on+custom+fields%2C+not+publish+date+in+WordPress+-++%28via+%40wpgarage%29&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22How%20to%20create%20an%20archive%20based%20on%20custom%20fields%2C%20not%20publish%20date%20in%20WordPress%22&amp;body=Link: http://wpgarage.com/code-snippets/how-to-create-an-archive-based-on-custom-fields-not-publish-date-in-wordpress/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A We%20recently%20launched%20a%20site%20called%20theforgottenletters.org%2C%20an%20incredible%20project%20dedicated%20to%20translating%20the%20Holocaust-era%20letters%20of%20Ralph%20Schwab%20from%20German%20to%20English.%20While%20building%20the%20site%2C%20we%20needed%20to%20archive%20the%20letters%20based%20on%20the%20dates%20the%20letters%20were%20written%2C%20not%20when%20we%20publish%20them" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
		<li class="shr-printfriendly">
			<a href="http://www.printfriendly.com/print?url=http://wpgarage.com/code-snippets/how-to-create-an-archive-based-on-custom-fields-not-publish-date-in-wordpress/" rel="nofollow" class="external" title="Send this page to Print Friendly">Send this page to Print Friendly</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://wpgarage.com/code-snippets/how-to-create-an-archive-based-on-custom-fields-not-publish-date-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to list Pages with custom fields in 2 columns in WordPress</title>
		<link>http://wpgarage.com/code-snippets/how-to-list-pages-with-custom-fields-in-2-columns-in-wordpress/</link>
		<comments>http://wpgarage.com/code-snippets/how-to-list-pages-with-custom-fields-in-2-columns-in-wordpress/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 11:51:11 +0000</pubDate>
		<dc:creator>Rebecca Markowitz</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[columns]]></category>
		<category><![CDATA[custom fields]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[Pages]]></category>

		<guid isPermaLink="false">http://wpgarage.com/?p=695</guid>
		<description><![CDATA[Recently, I needed to list all subpages of a parent page.  I also needed to display custom fields below each subpage. And, on top of that, the list needed to be 2 columns. I found a solution for simply listing the pages in 2 columns, but it did not suggest how to modify the code [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I needed to list all subpages of a parent page.  I also needed to display custom fields below each subpage. And, on top of that, the list needed to be 2 columns.</p>
<p>I found a <a href="http://www.livexp.net/wordpress/display-list-of-wordpress-pages-in-two-columns.html">solution</a> for simply listing the pages in 2 columns, but it did not suggest how to modify the code to include custom fields.</p>
<p>So, thanks to our coding hero <a href="http://marksw.com/wordpress/">Mark Kaplun</a> who supplied the below code, although he admits it&#8217;s a &#8220;dirty hack&#8221;. The sort_column is so that MyPageOrder would work properly for this listing.</p>
<blockquote><p>&lt;?php<br />
$args = array(<br />
&#8216;post_type&#8217; =&gt; &#8216;page&#8217;,<br />
&#8216;numberposts&#8217; =&gt; 40,<br />
&#8216;sort_column&#8217; =&gt; &#8216;menu_order&#8217;,<br />
&#8216;child_of&#8217; =&gt; 84 // any parent<br />
);<br />
$attachments = get_pages($args);<br />
//print_r(&#8220;attachements:&#8221; . $attachements);<br />
echo &#8216;&lt;div style=&#8221;float: left; margin: 0 10px 0 0;&#8221;&gt;&#8217;;<br />
?&gt;</p>
<p>&lt;?php<br />
for ($i =0; $i&lt;count($attachments)/2; $i++) {<br />
$post = $attachments[$i];<br />
//    foreach ($attachments as $post)  { ?&gt;</p>
<p>&lt;a href=&#8221;&lt;?php echo get_permalink($post-&gt;ID) ?&gt;&#8221; rel=&#8221;bookmark&#8221;&gt;&lt;?php echo $post-&gt;post_title; ?&gt;&lt;/a&gt;<br />
&lt;?php if(get_post_meta($post-&gt;ID, &#8220;NameofCustomField&#8221;, true)) { ?&gt;<br />
&lt;?php<br />
echo get_post_meta($post-&gt;ID, &#8220;NameofCustomField&#8221;, true);<br />
}<br />
?&gt;<br />
&lt;?php } ?&gt;<br />
&lt;/div&gt;<br />
&lt;?php<br />
echo &#8216;&lt;div style=&#8221;float: left; margin: 0 10px 0 0;&#8221;&gt;&#8217;;<br />
for (; $i&lt;count($attachments); $i++) {<br />
$post = $attachments[$i];<br />
//    foreach ($attachments as $post)  { ?&gt;</p>
<p>&lt;a href=&#8221;&lt;?php echo get_permalink($post-&gt;ID) ?&gt;&#8221; rel=&#8221;bookmark&#8221;&gt;&lt;?php echo $post-&gt;post_title; ?&gt;&lt;/a&gt;<br />
&lt;?php if(get_post_meta($post-&gt;ID, &#8220;PracticeArea&#8221;, true)) { ?&gt;<br />
&lt;?php<br />
echo get_post_meta($post-&gt;ID, &#8220;PracticeArea&#8221;, true);<br />
}<br />
?&gt;<br />
&lt;?php } ?&gt;<br />
&lt;/div&gt;</p></blockquote>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://wpgarage.com/code-snippets/how-to-list-pages-with-custom-fields-in-2-columns-in-wordpress/&amp;title=How+to+list+Pages+with+custom+fields+in+2+columns+in+WordPress" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://wpgarage.com/code-snippets/how-to-list-pages-with-custom-fields-in-2-columns-in-wordpress/&amp;title=How+to+list+Pages+with+custom+fields+in+2+columns+in+WordPress" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://wpgarage.com/code-snippets/how-to-list-pages-with-custom-fields-in-2-columns-in-wordpress/&amp;title=How+to+list+Pages+with+custom+fields+in+2+columns+in+WordPress&amp;desc=Recently%2C%20I%20needed%20to%20list%20all%20subpages%20of%20a%20parent%20page.%C2%A0%20I%20also%20needed%20to%20display%20custom%20fields%20below%20each%20subpage.%20And%2C%20on%20top%20of%20that%2C%20the%20list%20needed%20to%20be%202%20columns.%0D%0A%0D%0AI%20found%20a%20solution%20for%20simply%20listing%20the%20pages%20in%202%20columns%2C%20but%20it%20did%20not%20suggest%20how%20to%20modify%20the%20code%20to%20include%20custo" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://wpgarage.com/code-snippets/how-to-list-pages-with-custom-fields-in-2-columns-in-wordpress/&amp;t=How+to+list+Pages+with+custom+fields+in+2+columns+in+WordPress" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-friendfeed">
			<a href="http://www.friendfeed.com/share?title=How+to+list+Pages+with+custom+fields+in+2+columns+in+WordPress&amp;link=http://wpgarage.com/code-snippets/how-to-list-pages-with-custom-fields-in-2-columns-in-wordpress/" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="shr-gmail">
			<a href="https://mail.google.com/mail/?ui=2&amp;view=cm&amp;fs=1&amp;tf=1&amp;su=How+to+list+Pages+with+custom+fields+in+2+columns+in+WordPress&amp;body=Link: http://wpgarage.com/code-snippets/how-to-list-pages-with-custom-fields-in-2-columns-in-wordpress/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A Recently%2C%20I%20needed%20to%20list%20all%20subpages%20of%20a%20parent%20page.%C2%A0%20I%20also%20needed%20to%20display%20custom%20fields%20below%20each%20subpage.%20And%2C%20on%20top%20of%20that%2C%20the%20list%20needed%20to%20be%202%20columns.%0D%0A%0D%0AI%20found%20a%20solution%20for%20simply%20listing%20the%20pages%20in%202%20columns%2C%20but%20it%20did%20not%20suggest%20how%20to%20modify%20the%20code%20to%20include%20custo" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://wpgarage.com/code-snippets/how-to-list-pages-with-custom-fields-in-2-columns-in-wordpress/&amp;title=How+to+list+Pages+with+custom+fields+in+2+columns+in+WordPress" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://wpgarage.com/code-snippets/how-to-list-pages-with-custom-fields-in-2-columns-in-wordpress/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-googlereader">
			<a href="http://www.google.com/reader/link?url=http://wpgarage.com/code-snippets/how-to-list-pages-with-custom-fields-in-2-columns-in-wordpress/&amp;title=How+to+list+Pages+with+custom+fields+in+2+columns+in+WordPress&amp;srcUrl=http://wpgarage.com/code-snippets/how-to-list-pages-with-custom-fields-in-2-columns-in-wordpress/&amp;srcTitle=How+to+list+Pages+with+custom+fields+in+2+columns+in+WordPress&amp;snippet=Recently%2C%20I%20needed%20to%20list%20all%20subpages%20of%20a%20parent%20page.%C2%A0%20I%20also%20needed%20to%20display%20custom%20fields%20below%20each%20subpage.%20And%2C%20on%20top%20of%20that%2C%20the%20list%20needed%20to%20be%202%20columns.%0D%0A%0D%0AI%20found%20a%20solution%20for%20simply%20listing%20the%20pages%20in%202%20columns%2C%20but%20it%20did%20not%20suggest%20how%20to%20modify%20the%20code%20to%20include%20custo" rel="nofollow" class="external" title="Add this to Google Reader">Add this to Google Reader</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://wpgarage.com/code-snippets/how-to-list-pages-with-custom-fields-in-2-columns-in-wordpress/&amp;title=How+to+list+Pages+with+custom+fields+in+2+columns+in+WordPress&amp;summary=Recently%2C%20I%20needed%20to%20list%20all%20subpages%20of%20a%20parent%20page.%C2%A0%20I%20also%20needed%20to%20display%20custom%20fields%20below%20each%20subpage.%20And%2C%20on%20top%20of%20that%2C%20the%20list%20needed%20to%20be%202%20columns.%0D%0A%0D%0AI%20found%20a%20solution%20for%20simply%20listing%20the%20pages%20in%202%20columns%2C%20but%20it%20did%20not%20suggest%20how%20to%20modify%20the%20code%20to%20include%20custo&amp;source=WP Garage" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-netvibes">
			<a href="http://www.netvibes.com/share?title=How+to+list+Pages+with+custom+fields+in+2+columns+in+WordPress&amp;url=http://wpgarage.com/code-snippets/how-to-list-pages-with-custom-fields-in-2-columns-in-wordpress/" rel="nofollow" class="external" title="Submit this to Netvibes">Submit this to Netvibes</a>
		</li>
		<li class="shr-posterous">
			<a href="http://posterous.com/share?linkto=http://wpgarage.com/code-snippets/how-to-list-pages-with-custom-fields-in-2-columns-in-wordpress/&amp;title=How+to+list+Pages+with+custom+fields+in+2+columns+in+WordPress&amp;selection=Recently%2C%20I%20needed%20to%20list%20all%20subpages%20of%20a%20parent%20page.%C2%A0%20I%20also%20needed%20to%20display%20custom%20fields%20below%20each%20subpage.%20And%2C%20on%20top%20of%20that%2C%20the%20list%20needed%20to%20be%202%20columns.%0D%0A%0D%0AI%20found%20a%20solution%20for%20simply%20listing%20the%20pages%20in%202%20columns%2C%20but%20it%20did%20not%20suggest%20how%20to%20modify%20the%20code%20to%20include%20custo" rel="nofollow" class="external" title="Post this to Posterous">Post this to Posterous</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://wpgarage.com/code-snippets/how-to-list-pages-with-custom-fields-in-2-columns-in-wordpress/&amp;title=How+to+list+Pages+with+custom+fields+in+2+columns+in+WordPress" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-slashdot">
			<a href="http://slashdot.org/bookmark.pl?url=http://wpgarage.com/code-snippets/how-to-list-pages-with-custom-fields-in-2-columns-in-wordpress/&amp;title=How+to+list+Pages+with+custom+fields+in+2+columns+in+WordPress" rel="nofollow" class="external" title="Submit this to SlashDot">Submit this to SlashDot</a>
		</li>
		<li class="shr-sphinn">
			<a href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http://wpgarage.com/code-snippets/how-to-list-pages-with-custom-fields-in-2-columns-in-wordpress/" rel="nofollow" class="external" title="Sphinn this on Sphinn">Sphinn this on Sphinn</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://wpgarage.com/code-snippets/how-to-list-pages-with-custom-fields-in-2-columns-in-wordpress/&amp;title=How+to+list+Pages+with+custom+fields+in+2+columns+in+WordPress" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-techmeme">
			<a href="http://twitter.com/home/?status=Tip+@Techmeme+http://wpgarage.com/code-snippets/how-to-list-pages-with-custom-fields-in-2-columns-in-wordpress/+&quot;How+to+list+Pages+with+custom+fields+in+2+columns+in+WordPress&quot;&amp;source=shareaholic" rel="nofollow" class="external" title="Tip this to TechMeme">Tip this to TechMeme</a>
		</li>
		<li class="shr-tumblr">
			<a href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fwpgarage.com%2Fcode-snippets%2Fhow-to-list-pages-with-custom-fields-in-2-columns-in-wordpress%2F&amp;t=How+to+list+Pages+with+custom+fields+in+2+columns+in+WordPress" rel="nofollow" class="external" title="Share this on Tumblr">Share this on Tumblr</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=How+to+list+Pages+with+custom+fields+in+2+columns+in+WordPress+-++%28via+%40wpgarage%29&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22How%20to%20list%20Pages%20with%20custom%20fields%20in%202%20columns%20in%20WordPress%22&amp;body=Link: http://wpgarage.com/code-snippets/how-to-list-pages-with-custom-fields-in-2-columns-in-wordpress/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A Recently%2C%20I%20needed%20to%20list%20all%20subpages%20of%20a%20parent%20page.%C2%A0%20I%20also%20needed%20to%20display%20custom%20fields%20below%20each%20subpage.%20And%2C%20on%20top%20of%20that%2C%20the%20list%20needed%20to%20be%202%20columns.%0D%0A%0D%0AI%20found%20a%20solution%20for%20simply%20listing%20the%20pages%20in%202%20columns%2C%20but%20it%20did%20not%20suggest%20how%20to%20modify%20the%20code%20to%20include%20custo" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
		<li class="shr-printfriendly">
			<a href="http://www.printfriendly.com/print?url=http://wpgarage.com/code-snippets/how-to-list-pages-with-custom-fields-in-2-columns-in-wordpress/" rel="nofollow" class="external" title="Send this page to Print Friendly">Send this page to Print Friendly</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://wpgarage.com/code-snippets/how-to-list-pages-with-custom-fields-in-2-columns-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to get around WordPress&#8217; limitation on uploading certain file types</title>
		<link>http://wpgarage.com/code-snippets/changing-wordpress-list-accepted-file-types-for-upload/</link>
		<comments>http://wpgarage.com/code-snippets/changing-wordpress-list-accepted-file-types-for-upload/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 21:19:13 +0000</pubDate>
		<dc:creator>Miriam Schwab</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[file management]]></category>
		<category><![CDATA[functions.php]]></category>

		<guid isPermaLink="false">http://wpgarage.com/?p=674</guid>
		<description><![CDATA[One of our clients needed to upload files via their admin, and kept getting the following error message: “File type does not meet security guidelines. Try another.” This was something new to us, and after doing some research we discovered that WordPress only allows users to upload certain types of files, and any files that [...]]]></description>
			<content:encoded><![CDATA[<p>One of our clients needed to upload files via their admin, and kept getting the following error message: “File type does not meet security guidelines. Try another.”</p>
<p>This was something new to us, and after doing some research we discovered that WordPress only allows users to upload certain types of files, and any files that are not part of that list cannot be uploaded through the admin. Here’s the list of <a href="http://en.support.wordpress.com/accepted-filetypes/">accepted WordPress files types</a>.</p>
<p>It turns out that the list of accepted file types is found in <code>wp-includes/functions.php</code>. Since we don’t want to modify WordPress core files, we need a solution like a plugin in order to get around this limitation.</p>
<p>Chris Meller has a solution that involves adding some code to your functions.php file in your theme directory. He also explains how to remove file types from the list of allowed files types.</p>
<p>For more info on how to do this, see this post on his blog: <a href="http://chrismeller.com/2007/07/modifying-allowed-upload-types-in-wordpress/">Modifying Allowed Upload Types in WordPress</a>.</p>
<p>Thanks to <a title="Mark Kaplun's blog" href="http://marksw.com/wordpress/">Mark Kaplun</a> for helping us find this solution.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://wpgarage.com/code-snippets/changing-wordpress-list-accepted-file-types-for-upload/&amp;title=How+to+get+around+WordPress%27+limitation+on+uploading+certain+file+types" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://wpgarage.com/code-snippets/changing-wordpress-list-accepted-file-types-for-upload/&amp;title=How+to+get+around+WordPress%27+limitation+on+uploading+certain+file+types" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://wpgarage.com/code-snippets/changing-wordpress-list-accepted-file-types-for-upload/&amp;title=How+to+get+around+WordPress%27+limitation+on+uploading+certain+file+types&amp;desc=One%20of%20our%20clients%20needed%20to%20upload%20files%20via%20their%20admin%2C%20and%20kept%20getting%20the%20following%20error%20message%3A%20%E2%80%9CFile%20type%20does%20not%20meet%20security%20guidelines.%20Try%20another.%E2%80%9D%0D%0A%0D%0AThis%20was%20something%20new%20to%20us%2C%20and%20after%20doing%20some%20research%20we%20discovered%20that%20WordPress%20only%20allows%20users%20to%20upload%20certain%20typ" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://wpgarage.com/code-snippets/changing-wordpress-list-accepted-file-types-for-upload/&amp;t=How+to+get+around+WordPress%27+limitation+on+uploading+certain+file+types" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-friendfeed">
			<a href="http://www.friendfeed.com/share?title=How+to+get+around+WordPress%27+limitation+on+uploading+certain+file+types&amp;link=http://wpgarage.com/code-snippets/changing-wordpress-list-accepted-file-types-for-upload/" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="shr-gmail">
			<a href="https://mail.google.com/mail/?ui=2&amp;view=cm&amp;fs=1&amp;tf=1&amp;su=How+to+get+around+WordPress%27+limitation+on+uploading+certain+file+types&amp;body=Link: http://wpgarage.com/code-snippets/changing-wordpress-list-accepted-file-types-for-upload/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A One%20of%20our%20clients%20needed%20to%20upload%20files%20via%20their%20admin%2C%20and%20kept%20getting%20the%20following%20error%20message%3A%20%E2%80%9CFile%20type%20does%20not%20meet%20security%20guidelines.%20Try%20another.%E2%80%9D%0D%0A%0D%0AThis%20was%20something%20new%20to%20us%2C%20and%20after%20doing%20some%20research%20we%20discovered%20that%20WordPress%20only%20allows%20users%20to%20upload%20certain%20typ" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://wpgarage.com/code-snippets/changing-wordpress-list-accepted-file-types-for-upload/&amp;title=How+to+get+around+WordPress%27+limitation+on+uploading+certain+file+types" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://wpgarage.com/code-snippets/changing-wordpress-list-accepted-file-types-for-upload/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-googlereader">
			<a href="http://www.google.com/reader/link?url=http://wpgarage.com/code-snippets/changing-wordpress-list-accepted-file-types-for-upload/&amp;title=How+to+get+around+WordPress%27+limitation+on+uploading+certain+file+types&amp;srcUrl=http://wpgarage.com/code-snippets/changing-wordpress-list-accepted-file-types-for-upload/&amp;srcTitle=How+to+get+around+WordPress%27+limitation+on+uploading+certain+file+types&amp;snippet=One%20of%20our%20clients%20needed%20to%20upload%20files%20via%20their%20admin%2C%20and%20kept%20getting%20the%20following%20error%20message%3A%20%E2%80%9CFile%20type%20does%20not%20meet%20security%20guidelines.%20Try%20another.%E2%80%9D%0D%0A%0D%0AThis%20was%20something%20new%20to%20us%2C%20and%20after%20doing%20some%20research%20we%20discovered%20that%20WordPress%20only%20allows%20users%20to%20upload%20certain%20typ" rel="nofollow" class="external" title="Add this to Google Reader">Add this to Google Reader</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://wpgarage.com/code-snippets/changing-wordpress-list-accepted-file-types-for-upload/&amp;title=How+to+get+around+WordPress%27+limitation+on+uploading+certain+file+types&amp;summary=One%20of%20our%20clients%20needed%20to%20upload%20files%20via%20their%20admin%2C%20and%20kept%20getting%20the%20following%20error%20message%3A%20%E2%80%9CFile%20type%20does%20not%20meet%20security%20guidelines.%20Try%20another.%E2%80%9D%0D%0A%0D%0AThis%20was%20something%20new%20to%20us%2C%20and%20after%20doing%20some%20research%20we%20discovered%20that%20WordPress%20only%20allows%20users%20to%20upload%20certain%20typ&amp;source=WP Garage" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-netvibes">
			<a href="http://www.netvibes.com/share?title=How+to+get+around+WordPress%27+limitation+on+uploading+certain+file+types&amp;url=http://wpgarage.com/code-snippets/changing-wordpress-list-accepted-file-types-for-upload/" rel="nofollow" class="external" title="Submit this to Netvibes">Submit this to Netvibes</a>
		</li>
		<li class="shr-posterous">
			<a href="http://posterous.com/share?linkto=http://wpgarage.com/code-snippets/changing-wordpress-list-accepted-file-types-for-upload/&amp;title=How+to+get+around+WordPress%27+limitation+on+uploading+certain+file+types&amp;selection=One%20of%20our%20clients%20needed%20to%20upload%20files%20via%20their%20admin%2C%20and%20kept%20getting%20the%20following%20error%20message%3A%20%E2%80%9CFile%20type%20does%20not%20meet%20security%20guidelines.%20Try%20another.%E2%80%9D%0D%0A%0D%0AThis%20was%20something%20new%20to%20us%2C%20and%20after%20doing%20some%20research%20we%20discovered%20that%20WordPress%20only%20allows%20users%20to%20upload%20certain%20typ" rel="nofollow" class="external" title="Post this to Posterous">Post this to Posterous</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://wpgarage.com/code-snippets/changing-wordpress-list-accepted-file-types-for-upload/&amp;title=How+to+get+around+WordPress%27+limitation+on+uploading+certain+file+types" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-slashdot">
			<a href="http://slashdot.org/bookmark.pl?url=http://wpgarage.com/code-snippets/changing-wordpress-list-accepted-file-types-for-upload/&amp;title=How+to+get+around+WordPress%27+limitation+on+uploading+certain+file+types" rel="nofollow" class="external" title="Submit this to SlashDot">Submit this to SlashDot</a>
		</li>
		<li class="shr-sphinn">
			<a href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http://wpgarage.com/code-snippets/changing-wordpress-list-accepted-file-types-for-upload/" rel="nofollow" class="external" title="Sphinn this on Sphinn">Sphinn this on Sphinn</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://wpgarage.com/code-snippets/changing-wordpress-list-accepted-file-types-for-upload/&amp;title=How+to+get+around+WordPress%27+limitation+on+uploading+certain+file+types" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-techmeme">
			<a href="http://twitter.com/home/?status=Tip+@Techmeme+http://wpgarage.com/code-snippets/changing-wordpress-list-accepted-file-types-for-upload/+&quot;How+to+get+around+WordPress%27+limitation+on+uploading+certain+file+types&quot;&amp;source=shareaholic" rel="nofollow" class="external" title="Tip this to TechMeme">Tip this to TechMeme</a>
		</li>
		<li class="shr-tumblr">
			<a href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fwpgarage.com%2Fcode-snippets%2Fchanging-wordpress-list-accepted-file-types-for-upload%2F&amp;t=How+to+get+around+WordPress%27+limitation+on+uploading+certain+file+types" rel="nofollow" class="external" title="Share this on Tumblr">Share this on Tumblr</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=How+to+get+around+WordPress%27+limitation+on+uploading+certain+file+types+-++%28via+%40wpgarage%29&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22How%20to%20get%20around%20WordPress%27%20limitation%20on%20uploading%20certain%20file%20types%22&amp;body=Link: http://wpgarage.com/code-snippets/changing-wordpress-list-accepted-file-types-for-upload/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A One%20of%20our%20clients%20needed%20to%20upload%20files%20via%20their%20admin%2C%20and%20kept%20getting%20the%20following%20error%20message%3A%20%E2%80%9CFile%20type%20does%20not%20meet%20security%20guidelines.%20Try%20another.%E2%80%9D%0D%0A%0D%0AThis%20was%20something%20new%20to%20us%2C%20and%20after%20doing%20some%20research%20we%20discovered%20that%20WordPress%20only%20allows%20users%20to%20upload%20certain%20typ" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
		<li class="shr-printfriendly">
			<a href="http://www.printfriendly.com/print?url=http://wpgarage.com/code-snippets/changing-wordpress-list-accepted-file-types-for-upload/" rel="nofollow" class="external" title="Send this page to Print Friendly">Send this page to Print Friendly</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://wpgarage.com/code-snippets/changing-wordpress-list-accepted-file-types-for-upload/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Display sticky post and exclude it from recent posts list in WordPress</title>
		<link>http://wpgarage.com/code-snippets/display-sticky-post-and-exclude-it-from-recent-posts-list-in-wordpress/</link>
		<comments>http://wpgarage.com/code-snippets/display-sticky-post-and-exclude-it-from-recent-posts-list-in-wordpress/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 13:30:03 +0000</pubDate>
		<dc:creator>Rebecca Markowitz</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[exclude]]></category>
		<category><![CDATA[recent posts]]></category>
		<category><![CDATA[sticky posts]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://wpgarage.com/?p=592</guid>
		<description><![CDATA[We were working on a WordPress site that needed to display a sticky post at the top of the blog page with one style, and then below it a list of the most recent posts with a completely different style. I realize that you can just style the sticky post using the sticky-related classes provided [...]]]></description>
			<content:encoded><![CDATA[<p>We were working on a WordPress site that needed to display a sticky post at the top of the blog page with one style, and then below it a list of the most recent posts with a completely different style.</p>
<p>I realize that you can just style the sticky post using the sticky-related classes provided by WordPress:</p>
<blockquote><p>&lt;div &lt;?php post_class(); ?&gt;&gt; and .sticky class</p></blockquote>
<p>but I needed to have design elements appear in between the sticky post and the rest of the recent posts, and the recent posts needed to have a completely different design than the sticky. Therefore I decided to go with a 2 loop solution. Once we were using two loops, we had to also make sure that sticky post did not repeat itself and appear in the list of recent posts following it.</p>
<p><a href="http://www.nathanrice.net/blog/definitive-sticky-posts-guide-for-wordpress-27/">Nathan Rice</a> provides a lot of useful information about sticky posts but I couldn&#8217;t get the code he posted to work properly. So I went on a hunt to figure it out.</p>
<h2>How to display a sticky post</h2>
<p>The best solution I found for how to display a WordPress sticky post was a <a href="http://justintadlock.com/archives/2009/03/28/get-the-latest-sticky-posts-in-wordpress#comment-113133">comment </a>by <cite title="http://www.ethymos.com.br"></cite><a title="Eduardo" rel="external nofollow" href="http://www.ethymos.com.br/">Eduardo</a> on Justin Tadlock&#8217;s post <a title="Get the latest sticky posts in WordPress" href="http://justintadlock.com/archives/2009/03/28/get-the-latest-sticky-posts-in-wordpress">Get the Latest Sticky Post</a>. He gave the following code:</p>
<blockquote><p>&lt;?php<br />
$sticky = get_option( &#8216;sticky_posts&#8217; );<br />
query_posts( array( &#8216;post__in&#8217; =&gt; $sticky, &#8216;caller_get_posts&#8217; =&gt; 1, &#8216;orderby&#8217; =&gt; ID, &#8216;showposts&#8217; =&gt; 2 ) );<br />
?&gt;<br />
&lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;<br />
&lt;a href=&#8221;&lt;?php the_permalink(); ?&gt;&#8221; rel=&#8221;bookmark&#8221; title=&#8221;Permanent Link to &lt;?php the_title(); ?&gt;&#8221;&gt;<br />
&lt;?php endwhile;?&gt;</p>
<p>&lt;?php endif; ?&gt;</p></blockquote>
<p>It worked very nicely.</p>
<h2>How to exclude sticky posts from a list of recent posts</h2>
<p>I then wanted to show a list of 3 recent posts that excluded the post that had been defined as sticky. After many trials and errors with different solutions posted around the web, I finally found one that worked on the <a href="http://wordpress.org/support/topic/338776">WordPress Support Forum.</a></p>
<blockquote><p>&lt;?php $sticky = get_option(&#8216;sticky_posts&#8217;) ;</p>
<p>$post_to_exclude[] = $sticky[0];</p>
<p>$args=array(<br />
&#8216;caller_get_posts&#8217;=&gt;1,<br />
&#8216;showposts&#8217;=&gt;2,<br />
&#8216;post__not_in&#8217;=&gt; $post_to_exclude,<br />
);</p>
<p>query_posts($args); ?&gt;</p>
<p>&lt;h2&gt;&lt;a href=&#8221;&lt;?php the_permalink() ?&gt;&#8221;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt; &lt;/h2&gt;</p>
<p>&lt;?php while (have_posts()) : the_post();  ?&gt;</p>
<p>&lt;?php endwhile;?&gt;</p></blockquote>
<p>So there you have it: a workable way to have a WordPress sticky post with one style, and a list of recent posts excluding the sticky post with a completely different style below the sticky post.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://wpgarage.com/code-snippets/display-sticky-post-and-exclude-it-from-recent-posts-list-in-wordpress/&amp;title=Display+sticky+post+and+exclude+it+from+recent+posts+list+in+WordPress" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://wpgarage.com/code-snippets/display-sticky-post-and-exclude-it-from-recent-posts-list-in-wordpress/&amp;title=Display+sticky+post+and+exclude+it+from+recent+posts+list+in+WordPress" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://wpgarage.com/code-snippets/display-sticky-post-and-exclude-it-from-recent-posts-list-in-wordpress/&amp;title=Display+sticky+post+and+exclude+it+from+recent+posts+list+in+WordPress&amp;desc=We%20were%20working%20on%20a%20WordPress%20site%20that%20needed%20to%20display%20a%20sticky%20post%20at%20the%20top%20of%20the%20blog%20page%20with%20one%20style%2C%20and%20then%20below%20it%20a%20list%20of%20the%20most%20recent%20posts%20with%20a%20completely%20different%20style.%0D%0A%0D%0AI%20realize%20that%20you%20can%20just%20style%20the%20sticky%20post%20using%20the%20sticky-related%20classes%20provided%20by%20" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://wpgarage.com/code-snippets/display-sticky-post-and-exclude-it-from-recent-posts-list-in-wordpress/&amp;t=Display+sticky+post+and+exclude+it+from+recent+posts+list+in+WordPress" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-friendfeed">
			<a href="http://www.friendfeed.com/share?title=Display+sticky+post+and+exclude+it+from+recent+posts+list+in+WordPress&amp;link=http://wpgarage.com/code-snippets/display-sticky-post-and-exclude-it-from-recent-posts-list-in-wordpress/" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="shr-gmail">
			<a href="https://mail.google.com/mail/?ui=2&amp;view=cm&amp;fs=1&amp;tf=1&amp;su=Display+sticky+post+and+exclude+it+from+recent+posts+list+in+WordPress&amp;body=Link: http://wpgarage.com/code-snippets/display-sticky-post-and-exclude-it-from-recent-posts-list-in-wordpress/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A We%20were%20working%20on%20a%20WordPress%20site%20that%20needed%20to%20display%20a%20sticky%20post%20at%20the%20top%20of%20the%20blog%20page%20with%20one%20style%2C%20and%20then%20below%20it%20a%20list%20of%20the%20most%20recent%20posts%20with%20a%20completely%20different%20style.%0D%0A%0D%0AI%20realize%20that%20you%20can%20just%20style%20the%20sticky%20post%20using%20the%20sticky-related%20classes%20provided%20by%20" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://wpgarage.com/code-snippets/display-sticky-post-and-exclude-it-from-recent-posts-list-in-wordpress/&amp;title=Display+sticky+post+and+exclude+it+from+recent+posts+list+in+WordPress" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://wpgarage.com/code-snippets/display-sticky-post-and-exclude-it-from-recent-posts-list-in-wordpress/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-googlereader">
			<a href="http://www.google.com/reader/link?url=http://wpgarage.com/code-snippets/display-sticky-post-and-exclude-it-from-recent-posts-list-in-wordpress/&amp;title=Display+sticky+post+and+exclude+it+from+recent+posts+list+in+WordPress&amp;srcUrl=http://wpgarage.com/code-snippets/display-sticky-post-and-exclude-it-from-recent-posts-list-in-wordpress/&amp;srcTitle=Display+sticky+post+and+exclude+it+from+recent+posts+list+in+WordPress&amp;snippet=We%20were%20working%20on%20a%20WordPress%20site%20that%20needed%20to%20display%20a%20sticky%20post%20at%20the%20top%20of%20the%20blog%20page%20with%20one%20style%2C%20and%20then%20below%20it%20a%20list%20of%20the%20most%20recent%20posts%20with%20a%20completely%20different%20style.%0D%0A%0D%0AI%20realize%20that%20you%20can%20just%20style%20the%20sticky%20post%20using%20the%20sticky-related%20classes%20provided%20by%20" rel="nofollow" class="external" title="Add this to Google Reader">Add this to Google Reader</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://wpgarage.com/code-snippets/display-sticky-post-and-exclude-it-from-recent-posts-list-in-wordpress/&amp;title=Display+sticky+post+and+exclude+it+from+recent+posts+list+in+WordPress&amp;summary=We%20were%20working%20on%20a%20WordPress%20site%20that%20needed%20to%20display%20a%20sticky%20post%20at%20the%20top%20of%20the%20blog%20page%20with%20one%20style%2C%20and%20then%20below%20it%20a%20list%20of%20the%20most%20recent%20posts%20with%20a%20completely%20different%20style.%0D%0A%0D%0AI%20realize%20that%20you%20can%20just%20style%20the%20sticky%20post%20using%20the%20sticky-related%20classes%20provided%20by%20&amp;source=WP Garage" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-netvibes">
			<a href="http://www.netvibes.com/share?title=Display+sticky+post+and+exclude+it+from+recent+posts+list+in+WordPress&amp;url=http://wpgarage.com/code-snippets/display-sticky-post-and-exclude-it-from-recent-posts-list-in-wordpress/" rel="nofollow" class="external" title="Submit this to Netvibes">Submit this to Netvibes</a>
		</li>
		<li class="shr-posterous">
			<a href="http://posterous.com/share?linkto=http://wpgarage.com/code-snippets/display-sticky-post-and-exclude-it-from-recent-posts-list-in-wordpress/&amp;title=Display+sticky+post+and+exclude+it+from+recent+posts+list+in+WordPress&amp;selection=We%20were%20working%20on%20a%20WordPress%20site%20that%20needed%20to%20display%20a%20sticky%20post%20at%20the%20top%20of%20the%20blog%20page%20with%20one%20style%2C%20and%20then%20below%20it%20a%20list%20of%20the%20most%20recent%20posts%20with%20a%20completely%20different%20style.%0D%0A%0D%0AI%20realize%20that%20you%20can%20just%20style%20the%20sticky%20post%20using%20the%20sticky-related%20classes%20provided%20by%20" rel="nofollow" class="external" title="Post this to Posterous">Post this to Posterous</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://wpgarage.com/code-snippets/display-sticky-post-and-exclude-it-from-recent-posts-list-in-wordpress/&amp;title=Display+sticky+post+and+exclude+it+from+recent+posts+list+in+WordPress" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-slashdot">
			<a href="http://slashdot.org/bookmark.pl?url=http://wpgarage.com/code-snippets/display-sticky-post-and-exclude-it-from-recent-posts-list-in-wordpress/&amp;title=Display+sticky+post+and+exclude+it+from+recent+posts+list+in+WordPress" rel="nofollow" class="external" title="Submit this to SlashDot">Submit this to SlashDot</a>
		</li>
		<li class="shr-sphinn">
			<a href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http://wpgarage.com/code-snippets/display-sticky-post-and-exclude-it-from-recent-posts-list-in-wordpress/" rel="nofollow" class="external" title="Sphinn this on Sphinn">Sphinn this on Sphinn</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://wpgarage.com/code-snippets/display-sticky-post-and-exclude-it-from-recent-posts-list-in-wordpress/&amp;title=Display+sticky+post+and+exclude+it+from+recent+posts+list+in+WordPress" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-techmeme">
			<a href="http://twitter.com/home/?status=Tip+@Techmeme+http://wpgarage.com/code-snippets/display-sticky-post-and-exclude-it-from-recent-posts-list-in-wordpress/+&quot;Display+sticky+post+and+exclude+it+from+recent+posts+list+in+WordPress&quot;&amp;source=shareaholic" rel="nofollow" class="external" title="Tip this to TechMeme">Tip this to TechMeme</a>
		</li>
		<li class="shr-tumblr">
			<a href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fwpgarage.com%2Fcode-snippets%2Fdisplay-sticky-post-and-exclude-it-from-recent-posts-list-in-wordpress%2F&amp;t=Display+sticky+post+and+exclude+it+from+recent+posts+list+in+WordPress" rel="nofollow" class="external" title="Share this on Tumblr">Share this on Tumblr</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Display+sticky+post+and+exclude+it+from+recent+posts+list+in+WordPress+-++%28via+%40wpgarage%29&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22Display%20sticky%20post%20and%20exclude%20it%20from%20recent%20posts%20list%20in%20WordPress%22&amp;body=Link: http://wpgarage.com/code-snippets/display-sticky-post-and-exclude-it-from-recent-posts-list-in-wordpress/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A We%20were%20working%20on%20a%20WordPress%20site%20that%20needed%20to%20display%20a%20sticky%20post%20at%20the%20top%20of%20the%20blog%20page%20with%20one%20style%2C%20and%20then%20below%20it%20a%20list%20of%20the%20most%20recent%20posts%20with%20a%20completely%20different%20style.%0D%0A%0D%0AI%20realize%20that%20you%20can%20just%20style%20the%20sticky%20post%20using%20the%20sticky-related%20classes%20provided%20by%20" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
		<li class="shr-printfriendly">
			<a href="http://www.printfriendly.com/print?url=http://wpgarage.com/code-snippets/display-sticky-post-and-exclude-it-from-recent-posts-list-in-wordpress/" rel="nofollow" class="external" title="Send this page to Print Friendly">Send this page to Print Friendly</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://wpgarage.com/code-snippets/display-sticky-post-and-exclude-it-from-recent-posts-list-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How to list the 4 latest posts with only one post per author in WordPress</title>
		<link>http://wpgarage.com/code-snippets/list-4-latest-posts-with-only-one-post-per-author/</link>
		<comments>http://wpgarage.com/code-snippets/list-4-latest-posts-with-only-one-post-per-author/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 13:05:00 +0000</pubDate>
		<dc:creator>Rebecca Markowitz</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[author]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[recent posts]]></category>
		<category><![CDATA[sidebar]]></category>
		<category><![CDATA[thumbnails]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://wordpressgarage.com/code-snippets/list-4-latest-posts-with-only-one-post-per-author/</guid>
		<description><![CDATA[Recently, one site we were working on needed a sidebar that would show the 4 most recent posts on the site. But here’s the catch: they wanted only one post per author. And, each author had to have the role of “author” as opposed to contributor or admin. The site in question is still in [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, one site we were working on needed a sidebar that would show the 4 most recent posts on the site. But here’s the catch: they wanted only one post per author. And, each author had to have the role of “author” as opposed to contributor or admin.</p>
<p>The site in question is still in Beta, so I can’t give out the link yet. But here’s a snapshot to give you a better idea of what we were going for.</p>
<p><a href="http://wpgarage.com/wp-content/uploads/2009/09/wpgblogs.jpg"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="wpgblogs" src="http://wpgarage.com/wp-content/uploads/2009/09/wpgblogs_thumb.jpg" border="0" alt="wpgblogs" width="192" height="244" /></a></p>
<p>We also used the plugin <a href="http://wordpress.org/extend/plugins/user-photo/">User Photo</a> to show each author’s thumbnail, which I have come to love and recommend.</p>
<p>Thanks to <a href="http://www.marksw.com/blog/wordpress/">Mark Kaplun</a> for this great solution:</p>
<p>Open your Sidebar.php file and add the following:</p>
<p>Please note: this code uses the plugin Limit Posts to create excerpts. But you can substitute that snippet with any type of excerpt code.</p>
<p>&lt;?php $authors = get_users_of_blog(); ?&gt;</p>
<p>&lt;?php<br />
$latest_posts = array();<br />
foreach ( $authors as $author ) {<br />
$user = new WP_User( $author-&gt;ID );<br />
if ($user-&gt;has_cap(&#8216;level_7&#8242;))<br />
continue;<br />
$ps = get_posts(&#8216;numberposts=1&amp;post_type=post&amp;author=&#8217; . $author-&gt;ID . &#8216;&amp;cat=-9,-3&#8242;);<br />
foreach ($ps as $p) {<br />
$latest_posts[$p-&gt;post_date] = $p;<br />
}<br />
}<br />
krsort($latest_posts);<br />
?&gt;<br />
&lt;?php //query_posts(&#8216;author=&#8217; . $author-&gt;ID . &#8216;&amp;showposts=1&amp;cat=-9,-3&#8242;); ?&gt;<br />
&lt;?php<br />
$counter =0;<br />
foreach ($latest_posts as $post) {<br />
$counter++;<br />
if ($counter &gt; 4)<br />
break;<br />
setup_postdata($post);<br />
?&gt;</p>
<p>&lt;?php // while (have_posts()) : the_post(); ?&gt;</p>
<p>&lt;li&gt;<br />
&lt;?php userphoto_the_author_thumbnail(); ?&gt;<br />
&lt;span class=&#8221;blogauthor&#8221;&gt; &lt;?php the_author_posts_link(); ?&gt; &lt;/span&gt;<br />
&lt;div class=&#8221;blog&#8221;&gt;    &lt;a title=&#8221;Permanent Link to &lt;?php the_title(); ?&gt;&#8221; href=&#8221;&lt;?php the_permalink() ?&gt;&#8221; rel=&#8221;bookmark&#8221;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/div&gt;<br />
&lt;br /&gt;</p>
<p>&lt;?php  the_content_limit(&#8217;55,read more&#8217;); ?&gt; &lt;strong&gt;&lt;a title=&#8221;Permanent Link to &lt;?php the_title(); ?&gt;&#8221; href=&#8221;&lt;?php the_permalink() ?&gt;&#8221;&gt;Read more&lt;/a&gt;   &lt;/strong&gt;<br />
&lt;/li&gt;<br />
&lt;?php } ?&gt;</p>
<p>&lt;?php // }; ?&gt;</p>
<p>The End. Yay code!</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://wpgarage.com/code-snippets/list-4-latest-posts-with-only-one-post-per-author/&amp;title=How+to+list+the+4+latest+posts+with+only+one+post+per+author+in+WordPress" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://wpgarage.com/code-snippets/list-4-latest-posts-with-only-one-post-per-author/&amp;title=How+to+list+the+4+latest+posts+with+only+one+post+per+author+in+WordPress" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://wpgarage.com/code-snippets/list-4-latest-posts-with-only-one-post-per-author/&amp;title=How+to+list+the+4+latest+posts+with+only+one+post+per+author+in+WordPress&amp;desc=Recently%2C%20one%20site%20we%20were%20working%20on%20needed%20a%20sidebar%20that%20would%20show%20the%204%20most%20recent%20posts%20on%20the%20site.%20But%20here%E2%80%99s%20the%20catch%3A%20they%20wanted%20only%20one%20post%20per%20author.%20And%2C%20each%20author%20had%20to%20have%20the%20role%20of%20%E2%80%9Cauthor%E2%80%9D%20as%20opposed%20to%20contributor%20or%20admin.%0D%0A%0D%0AThe%20site%20in%20question%20is%20still%20in%20Beta" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://wpgarage.com/code-snippets/list-4-latest-posts-with-only-one-post-per-author/&amp;t=How+to+list+the+4+latest+posts+with+only+one+post+per+author+in+WordPress" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-friendfeed">
			<a href="http://www.friendfeed.com/share?title=How+to+list+the+4+latest+posts+with+only+one+post+per+author+in+WordPress&amp;link=http://wpgarage.com/code-snippets/list-4-latest-posts-with-only-one-post-per-author/" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="shr-gmail">
			<a href="https://mail.google.com/mail/?ui=2&amp;view=cm&amp;fs=1&amp;tf=1&amp;su=How+to+list+the+4+latest+posts+with+only+one+post+per+author+in+WordPress&amp;body=Link: http://wpgarage.com/code-snippets/list-4-latest-posts-with-only-one-post-per-author/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A Recently%2C%20one%20site%20we%20were%20working%20on%20needed%20a%20sidebar%20that%20would%20show%20the%204%20most%20recent%20posts%20on%20the%20site.%20But%20here%E2%80%99s%20the%20catch%3A%20they%20wanted%20only%20one%20post%20per%20author.%20And%2C%20each%20author%20had%20to%20have%20the%20role%20of%20%E2%80%9Cauthor%E2%80%9D%20as%20opposed%20to%20contributor%20or%20admin.%0D%0A%0D%0AThe%20site%20in%20question%20is%20still%20in%20Beta" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://wpgarage.com/code-snippets/list-4-latest-posts-with-only-one-post-per-author/&amp;title=How+to+list+the+4+latest+posts+with+only+one+post+per+author+in+WordPress" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://wpgarage.com/code-snippets/list-4-latest-posts-with-only-one-post-per-author/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-googlereader">
			<a href="http://www.google.com/reader/link?url=http://wpgarage.com/code-snippets/list-4-latest-posts-with-only-one-post-per-author/&amp;title=How+to+list+the+4+latest+posts+with+only+one+post+per+author+in+WordPress&amp;srcUrl=http://wpgarage.com/code-snippets/list-4-latest-posts-with-only-one-post-per-author/&amp;srcTitle=How+to+list+the+4+latest+posts+with+only+one+post+per+author+in+WordPress&amp;snippet=Recently%2C%20one%20site%20we%20were%20working%20on%20needed%20a%20sidebar%20that%20would%20show%20the%204%20most%20recent%20posts%20on%20the%20site.%20But%20here%E2%80%99s%20the%20catch%3A%20they%20wanted%20only%20one%20post%20per%20author.%20And%2C%20each%20author%20had%20to%20have%20the%20role%20of%20%E2%80%9Cauthor%E2%80%9D%20as%20opposed%20to%20contributor%20or%20admin.%0D%0A%0D%0AThe%20site%20in%20question%20is%20still%20in%20Beta" rel="nofollow" class="external" title="Add this to Google Reader">Add this to Google Reader</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://wpgarage.com/code-snippets/list-4-latest-posts-with-only-one-post-per-author/&amp;title=How+to+list+the+4+latest+posts+with+only+one+post+per+author+in+WordPress&amp;summary=Recently%2C%20one%20site%20we%20were%20working%20on%20needed%20a%20sidebar%20that%20would%20show%20the%204%20most%20recent%20posts%20on%20the%20site.%20But%20here%E2%80%99s%20the%20catch%3A%20they%20wanted%20only%20one%20post%20per%20author.%20And%2C%20each%20author%20had%20to%20have%20the%20role%20of%20%E2%80%9Cauthor%E2%80%9D%20as%20opposed%20to%20contributor%20or%20admin.%0D%0A%0D%0AThe%20site%20in%20question%20is%20still%20in%20Beta&amp;source=WP Garage" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-netvibes">
			<a href="http://www.netvibes.com/share?title=How+to+list+the+4+latest+posts+with+only+one+post+per+author+in+WordPress&amp;url=http://wpgarage.com/code-snippets/list-4-latest-posts-with-only-one-post-per-author/" rel="nofollow" class="external" title="Submit this to Netvibes">Submit this to Netvibes</a>
		</li>
		<li class="shr-posterous">
			<a href="http://posterous.com/share?linkto=http://wpgarage.com/code-snippets/list-4-latest-posts-with-only-one-post-per-author/&amp;title=How+to+list+the+4+latest+posts+with+only+one+post+per+author+in+WordPress&amp;selection=Recently%2C%20one%20site%20we%20were%20working%20on%20needed%20a%20sidebar%20that%20would%20show%20the%204%20most%20recent%20posts%20on%20the%20site.%20But%20here%E2%80%99s%20the%20catch%3A%20they%20wanted%20only%20one%20post%20per%20author.%20And%2C%20each%20author%20had%20to%20have%20the%20role%20of%20%E2%80%9Cauthor%E2%80%9D%20as%20opposed%20to%20contributor%20or%20admin.%0D%0A%0D%0AThe%20site%20in%20question%20is%20still%20in%20Beta" rel="nofollow" class="external" title="Post this to Posterous">Post this to Posterous</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://wpgarage.com/code-snippets/list-4-latest-posts-with-only-one-post-per-author/&amp;title=How+to+list+the+4+latest+posts+with+only+one+post+per+author+in+WordPress" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-slashdot">
			<a href="http://slashdot.org/bookmark.pl?url=http://wpgarage.com/code-snippets/list-4-latest-posts-with-only-one-post-per-author/&amp;title=How+to+list+the+4+latest+posts+with+only+one+post+per+author+in+WordPress" rel="nofollow" class="external" title="Submit this to SlashDot">Submit this to SlashDot</a>
		</li>
		<li class="shr-sphinn">
			<a href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http://wpgarage.com/code-snippets/list-4-latest-posts-with-only-one-post-per-author/" rel="nofollow" class="external" title="Sphinn this on Sphinn">Sphinn this on Sphinn</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://wpgarage.com/code-snippets/list-4-latest-posts-with-only-one-post-per-author/&amp;title=How+to+list+the+4+latest+posts+with+only+one+post+per+author+in+WordPress" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-techmeme">
			<a href="http://twitter.com/home/?status=Tip+@Techmeme+http://wpgarage.com/code-snippets/list-4-latest-posts-with-only-one-post-per-author/+&quot;How+to+list+the+4+latest+posts+with+only+one+post+per+author+in+WordPress&quot;&amp;source=shareaholic" rel="nofollow" class="external" title="Tip this to TechMeme">Tip this to TechMeme</a>
		</li>
		<li class="shr-tumblr">
			<a href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fwpgarage.com%2Fcode-snippets%2Flist-4-latest-posts-with-only-one-post-per-author%2F&amp;t=How+to+list+the+4+latest+posts+with+only+one+post+per+author+in+WordPress" rel="nofollow" class="external" title="Share this on Tumblr">Share this on Tumblr</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=How+to+list+the+4+latest+posts+with+only+one+post+per+author+in+WordPress+-++%28via+%40wpgarage%29&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22How%20to%20list%20the%204%20latest%20posts%20with%20only%20one%20post%20per%20author%20in%20WordPress%22&amp;body=Link: http://wpgarage.com/code-snippets/list-4-latest-posts-with-only-one-post-per-author/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A Recently%2C%20one%20site%20we%20were%20working%20on%20needed%20a%20sidebar%20that%20would%20show%20the%204%20most%20recent%20posts%20on%20the%20site.%20But%20here%E2%80%99s%20the%20catch%3A%20they%20wanted%20only%20one%20post%20per%20author.%20And%2C%20each%20author%20had%20to%20have%20the%20role%20of%20%E2%80%9Cauthor%E2%80%9D%20as%20opposed%20to%20contributor%20or%20admin.%0D%0A%0D%0AThe%20site%20in%20question%20is%20still%20in%20Beta" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
		<li class="shr-printfriendly">
			<a href="http://www.printfriendly.com/print?url=http://wpgarage.com/code-snippets/list-4-latest-posts-with-only-one-post-per-author/" rel="nofollow" class="external" title="Send this page to Print Friendly">Send this page to Print Friendly</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://wpgarage.com/code-snippets/list-4-latest-posts-with-only-one-post-per-author/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>How to Customize Multiple Search Result Pages in WordPress</title>
		<link>http://wpgarage.com/code-snippets/how-to-customize-multiple-search-result-pages-in-wordpress/</link>
		<comments>http://wpgarage.com/code-snippets/how-to-customize-multiple-search-result-pages-in-wordpress/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 07:26:02 +0000</pubDate>
		<dc:creator>Rebecca Markowitz</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[WordPress as CMS]]></category>
		<category><![CDATA[customize]]></category>
		<category><![CDATA[multiple]]></category>
		<category><![CDATA[Pages]]></category>
		<category><![CDATA[results]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://wordpressgarage.com/?p=498</guid>
		<description><![CDATA[In the previous post, we discussed how to hack the search function in WordPress to have an additional search form that would search  subcategories. Now that you have 2 or more search forms on your site, you might need to customize the search results. Thanks to this solution, I learned how to create multiple search [...]]]></description>
			<content:encoded><![CDATA[<p>In the previous post, we discussed how to <a href="http://wpgarage.com/code-snippets/how-to-hack-the-wordpress-search-function-search-categories-and-child-categories/">hack the search function</a> in WordPress to have an additional search form that would search  subcategories. Now that you have 2 or more search forms on your site, you might need to customize the search results. Thanks to <a href="http://www.rob-barrett.com/post/multiple-search-results-pages-within-one-wordpress-site">this solution</a>, I learned how to create multiple search result pages.</p>
<p>Let&#8217;s say we have 2 search forms on our site:</p>
<ol>
<li>General Site-Wide Search</li>
<li>Recipe Search &#8211; searches subcategories of the Recipe Category</li>
</ol>
<p>The first thing we need to do is tweak the search.php template to use it as a filter that will recognize if a search is coming from the Site-Wide search form or the Recipe Search form.</p>
<p><strong>1. Open Search.php</strong> and delete everything.  Add the following code:</p>
<blockquote><p>&lt;?php<br />
/* Template Name: Search Results */<br />
$search_refer = $_GET["site_section"];<br />
if ($search_refer == &#8216;recipe&#8217;) { load_template(TEMPLATEPATH . &#8216;/recipe-search.php&#8217;); }<br />
elseif ($search_refer == &#8216;site-search&#8217;) { load_template(TEMPLATEPATH . &#8216;/site-search.php&#8217;); }; ?&gt;</p></blockquote>
<p><strong>2. Open Header.php</strong> or wherever the General Site-Wide Search Form is located and add this line:</p>
<blockquote><p>&lt;input type=&#8221;hidden&#8221; name=&#8221;site_section&#8221; value=&#8221;site-search&#8221; /&gt;</p></blockquote>
<p><strong>The Site-Wide Search form will look something like this:</strong></p>
<blockquote><p>&lt;form method=&#8221;get&#8221; id=&#8221;searchform&#8221; action=&#8221;&lt;?php bloginfo(&#8216;home&#8217;); ?&gt;/&#8221;&gt;<br />
&lt;div id=&#8221;search&#8221;&gt;<br />
&lt;input type=&#8221;text&#8221; value=&#8221; &#8221; onclick=&#8221;this.value=&#8221;;&#8221; name=&#8221;s&#8221; id=&#8221;s&#8221; /&gt;<strong><br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;site_section&#8221; value=&#8221;site-search&#8221; /&gt;</strong><br />
&lt;input name=&#8221;" type=&#8221;image&#8221; src=&#8221;&lt;?php bloginfo(&#8216;stylesheet_directory&#8217;); ?&gt;/styles/&lt;?php echo &#8220;$style_path&#8221;; ?&gt;/search.gif&#8221; value=&#8221;Go&#8221; /&gt;<br />
&lt;/div&gt;&lt;!&#8211;/search &#8211;&gt;<br />
&lt;/form&gt;</p></blockquote>
<p><strong>3. </strong><strong>Open Recipes.php</strong> or wherever your second search is and insert this line:</p>
<blockquote><p><strong>&lt;input type=&#8221;hidden&#8221; name=&#8221;site_section&#8221; value=&#8221;recipe&#8221; /&gt; </strong></p></blockquote>
<p>You can change the value &#8220;recipe&#8221; to whatever suits your needs. Just make sure it matches the value in search.php.</p>
<p><strong>The Recipe Search form for your second search</strong> <strong>will look something like this</strong>. In my case, this second search is meant to search the subcategories of the Recipe category.  See my previous post to learn about<a href="http://wpgarage.com/code-snippets/how-to-hack-the-wordpress-search-function-search-categories-and-child-categories/"> hacking the search function to search subcategories.</a></p>
<blockquote><p>&lt;form method=&#8221;get&#8221; id=&#8221;rsearchform&#8221; action=&#8221;&lt;?php bloginfo(&#8216;home&#8217;); ?&gt;/&#8221;&gt;<br />
&lt;div id=&#8221;rsearch&#8221;&gt;<br />
&lt;input type=&#8221;text&#8221; value=&#8221;Recipe Search&#8230; &#8221; onclick=&#8221;this.value=&#8221;;&#8221; name=&#8221;s&#8221; id=&#8221;rs&#8221; /&gt;<br />
&lt;?php $categories = get_categories(&#8216;child_of=11&#8242;);<br />
$catlist = &#8221;;<br />
foreach ($categories as $cat) {<br />
$catlist.= $cat-&gt;cat_ID.&#8217;,';<br />
}<br />
$catlist.&#8217;11&#8242;;<br />
?&gt;<br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;cat&#8221; value=&#8221;&lt;?php echo &#8220;$catlist&#8221;?&gt;&#8221; /&gt;<br />
<strong>&lt;input type=&#8221;hidden&#8221; name=&#8221;site_section&#8221; value=&#8221;recipe&#8221; /&gt; </strong><br />
&lt;input name=&#8221;" type=&#8221;image&#8221; src=&#8221;&lt;?php bloginfo(&#8216;stylesheet_directory&#8217;); ?&gt;/styles/&lt;?php echo &#8220;$style_path&#8221;; ?&gt;/search.gif&#8221; value=&#8221;Go&#8221; /&gt;<br />
&lt;/div&gt;&lt;!&#8211;/search &#8211;&gt;<br />
&lt;/form&gt;</p></blockquote>
<p><strong>4. Customize the Search Results Templates</strong></p>
<p>If you recall, in step 1, we added the following to the search.php page.</p>
<blockquote><p>if ($search_refer == &#8216;recipe&#8217;) { load_template(TEMPLATEPATH . &#8216;/recipe-search.php&#8217;); }<br />
elseif ($search_refer == &#8216;site-search&#8217;) { load_template(TEMPLATEPATH . &#8216;/site-search.php&#8217;); }; ?&gt;</p></blockquote>
<p>Create recipe-search.php (or whatever you named this template) and customize the layout of the results page to your liking. You can use index.php to start with and customize from there.</p>
<p>Create site-search.php (or whatever you named this template) and customize the layout of the results page to your liking. You can use index.php to start with and customize from there.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://wpgarage.com/code-snippets/how-to-customize-multiple-search-result-pages-in-wordpress/&amp;title=How+to+Customize+Multiple+Search+Result+Pages+in+Wordpress" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://wpgarage.com/code-snippets/how-to-customize-multiple-search-result-pages-in-wordpress/&amp;title=How+to+Customize+Multiple+Search+Result+Pages+in+Wordpress" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://wpgarage.com/code-snippets/how-to-customize-multiple-search-result-pages-in-wordpress/&amp;title=How+to+Customize+Multiple+Search+Result+Pages+in+Wordpress&amp;desc=In%20the%20previous%20post%2C%20we%20discussed%20how%20to%20hack%20the%20search%20function%20in%20Wordpress%20to%20have%20an%20additional%20search%20form%20that%20would%20search%C2%A0%20subcategories.%20Now%20that%20you%20have%202%20or%20more%20search%20forms%20on%20your%20site%2C%20you%20might%20need%20to%20customize%20the%20search%20results.%20Thanks%20to%20this%20solution%2C%20I%20learned%20how%20to%20create" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://wpgarage.com/code-snippets/how-to-customize-multiple-search-result-pages-in-wordpress/&amp;t=How+to+Customize+Multiple+Search+Result+Pages+in+Wordpress" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-friendfeed">
			<a href="http://www.friendfeed.com/share?title=How+to+Customize+Multiple+Search+Result+Pages+in+Wordpress&amp;link=http://wpgarage.com/code-snippets/how-to-customize-multiple-search-result-pages-in-wordpress/" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="shr-gmail">
			<a href="https://mail.google.com/mail/?ui=2&amp;view=cm&amp;fs=1&amp;tf=1&amp;su=How+to+Customize+Multiple+Search+Result+Pages+in+Wordpress&amp;body=Link: http://wpgarage.com/code-snippets/how-to-customize-multiple-search-result-pages-in-wordpress/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A In%20the%20previous%20post%2C%20we%20discussed%20how%20to%20hack%20the%20search%20function%20in%20Wordpress%20to%20have%20an%20additional%20search%20form%20that%20would%20search%C2%A0%20subcategories.%20Now%20that%20you%20have%202%20or%20more%20search%20forms%20on%20your%20site%2C%20you%20might%20need%20to%20customize%20the%20search%20results.%20Thanks%20to%20this%20solution%2C%20I%20learned%20how%20to%20create" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://wpgarage.com/code-snippets/how-to-customize-multiple-search-result-pages-in-wordpress/&amp;title=How+to+Customize+Multiple+Search+Result+Pages+in+Wordpress" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://wpgarage.com/code-snippets/how-to-customize-multiple-search-result-pages-in-wordpress/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-googlereader">
			<a href="http://www.google.com/reader/link?url=http://wpgarage.com/code-snippets/how-to-customize-multiple-search-result-pages-in-wordpress/&amp;title=How+to+Customize+Multiple+Search+Result+Pages+in+Wordpress&amp;srcUrl=http://wpgarage.com/code-snippets/how-to-customize-multiple-search-result-pages-in-wordpress/&amp;srcTitle=How+to+Customize+Multiple+Search+Result+Pages+in+Wordpress&amp;snippet=In%20the%20previous%20post%2C%20we%20discussed%20how%20to%20hack%20the%20search%20function%20in%20Wordpress%20to%20have%20an%20additional%20search%20form%20that%20would%20search%C2%A0%20subcategories.%20Now%20that%20you%20have%202%20or%20more%20search%20forms%20on%20your%20site%2C%20you%20might%20need%20to%20customize%20the%20search%20results.%20Thanks%20to%20this%20solution%2C%20I%20learned%20how%20to%20create" rel="nofollow" class="external" title="Add this to Google Reader">Add this to Google Reader</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://wpgarage.com/code-snippets/how-to-customize-multiple-search-result-pages-in-wordpress/&amp;title=How+to+Customize+Multiple+Search+Result+Pages+in+Wordpress&amp;summary=In%20the%20previous%20post%2C%20we%20discussed%20how%20to%20hack%20the%20search%20function%20in%20Wordpress%20to%20have%20an%20additional%20search%20form%20that%20would%20search%C2%A0%20subcategories.%20Now%20that%20you%20have%202%20or%20more%20search%20forms%20on%20your%20site%2C%20you%20might%20need%20to%20customize%20the%20search%20results.%20Thanks%20to%20this%20solution%2C%20I%20learned%20how%20to%20create&amp;source=WP Garage" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-netvibes">
			<a href="http://www.netvibes.com/share?title=How+to+Customize+Multiple+Search+Result+Pages+in+Wordpress&amp;url=http://wpgarage.com/code-snippets/how-to-customize-multiple-search-result-pages-in-wordpress/" rel="nofollow" class="external" title="Submit this to Netvibes">Submit this to Netvibes</a>
		</li>
		<li class="shr-posterous">
			<a href="http://posterous.com/share?linkto=http://wpgarage.com/code-snippets/how-to-customize-multiple-search-result-pages-in-wordpress/&amp;title=How+to+Customize+Multiple+Search+Result+Pages+in+Wordpress&amp;selection=In%20the%20previous%20post%2C%20we%20discussed%20how%20to%20hack%20the%20search%20function%20in%20Wordpress%20to%20have%20an%20additional%20search%20form%20that%20would%20search%C2%A0%20subcategories.%20Now%20that%20you%20have%202%20or%20more%20search%20forms%20on%20your%20site%2C%20you%20might%20need%20to%20customize%20the%20search%20results.%20Thanks%20to%20this%20solution%2C%20I%20learned%20how%20to%20create" rel="nofollow" class="external" title="Post this to Posterous">Post this to Posterous</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://wpgarage.com/code-snippets/how-to-customize-multiple-search-result-pages-in-wordpress/&amp;title=How+to+Customize+Multiple+Search+Result+Pages+in+Wordpress" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-slashdot">
			<a href="http://slashdot.org/bookmark.pl?url=http://wpgarage.com/code-snippets/how-to-customize-multiple-search-result-pages-in-wordpress/&amp;title=How+to+Customize+Multiple+Search+Result+Pages+in+Wordpress" rel="nofollow" class="external" title="Submit this to SlashDot">Submit this to SlashDot</a>
		</li>
		<li class="shr-sphinn">
			<a href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http://wpgarage.com/code-snippets/how-to-customize-multiple-search-result-pages-in-wordpress/" rel="nofollow" class="external" title="Sphinn this on Sphinn">Sphinn this on Sphinn</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://wpgarage.com/code-snippets/how-to-customize-multiple-search-result-pages-in-wordpress/&amp;title=How+to+Customize+Multiple+Search+Result+Pages+in+Wordpress" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-techmeme">
			<a href="http://twitter.com/home/?status=Tip+@Techmeme+http://wpgarage.com/code-snippets/how-to-customize-multiple-search-result-pages-in-wordpress/+&quot;How+to+Customize+Multiple+Search+Result+Pages+in+Wordpress&quot;&amp;source=shareaholic" rel="nofollow" class="external" title="Tip this to TechMeme">Tip this to TechMeme</a>
		</li>
		<li class="shr-tumblr">
			<a href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fwpgarage.com%2Fcode-snippets%2Fhow-to-customize-multiple-search-result-pages-in-wordpress%2F&amp;t=How+to+Customize+Multiple+Search+Result+Pages+in+Wordpress" rel="nofollow" class="external" title="Share this on Tumblr">Share this on Tumblr</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=How+to+Customize+Multiple+Search+Result+Pages+in+Wordpress+-++%28via+%40wpgarage%29&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22How%20to%20Customize%20Multiple%20Search%20Result%20Pages%20in%20Wordpress%22&amp;body=Link: http://wpgarage.com/code-snippets/how-to-customize-multiple-search-result-pages-in-wordpress/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A In%20the%20previous%20post%2C%20we%20discussed%20how%20to%20hack%20the%20search%20function%20in%20Wordpress%20to%20have%20an%20additional%20search%20form%20that%20would%20search%C2%A0%20subcategories.%20Now%20that%20you%20have%202%20or%20more%20search%20forms%20on%20your%20site%2C%20you%20might%20need%20to%20customize%20the%20search%20results.%20Thanks%20to%20this%20solution%2C%20I%20learned%20how%20to%20create" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
		<li class="shr-printfriendly">
			<a href="http://www.printfriendly.com/print?url=http://wpgarage.com/code-snippets/how-to-customize-multiple-search-result-pages-in-wordpress/" rel="nofollow" class="external" title="Send this page to Print Friendly">Send this page to Print Friendly</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://wpgarage.com/code-snippets/how-to-customize-multiple-search-result-pages-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Hack the WordPress Search Function: Search Categories and Child Categories</title>
		<link>http://wpgarage.com/code-snippets/how-to-hack-the-wordpress-search-function-search-categories-and-child-categories/</link>
		<comments>http://wpgarage.com/code-snippets/how-to-hack-the-wordpress-search-function-search-categories-and-child-categories/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 06:23:56 +0000</pubDate>
		<dc:creator>Rebecca Markowitz</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[WordPress as CMS]]></category>
		<category><![CDATA[category]]></category>
		<category><![CDATA[child category]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[parent category]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[subcategory]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://wordpressgarage.com/code-snippets/how-to-hack-the-wordpress-search-function-search-categories-and-child-categories/</guid>
		<description><![CDATA[Recently, we had a client who wanted a special recipe search. There were 2 ways to extend the search functionality &#8211; manually or dynamically. 1. Search One or More Categories Manually If we want to search one category, we could have used this solution which lets you manually add category numbers to the search function: [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, we had a client who wanted a special recipe search. There were 2 ways to extend the search functionality &#8211; manually or dynamically.</p>
<p><strong>1. Search One or More Categories Manually<br />
</strong></p>
<p>If we want to search <strong>one category</strong>, we could have used this <a href="http://www.sandboxdev.com/blog/wordpress/123/search-specific-category-in-wordpress/">solution</a> which lets you manually add category numbers to the search function:</p>
<p>[Replace value="5" with your category number.]</p>
<blockquote><p>&lt;form method=&#8221;get&#8221; id=&#8221;searchform&#8221; action=&#8221;&lt;?php bloginfo(&#8216;home&#8217;); ?&gt;/&#8221;&gt;<br />
&lt;div&gt;<br />
&lt;input type=&#8221;text&#8221; value=&#8221;&lt;?php echo wp_specialchars($s, 1); ?&gt;&#8221; name=&#8221;s&#8221; id=&#8221;s&#8221; /&gt;<br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;cat&#8221; value=&#8221;5&#8243; /&gt;<br />
&lt;input type=&#8221;submit&#8221; id=&#8221;searchsubmit&#8221; value=&#8221;Search&#8221; /&gt;<br />
&lt;/div&gt;<br />
&lt;/form&gt;</p></blockquote>
<p><strong>2. Search Subcategories Dynamically</strong></p>
<p>However, we wanted to dynamically search <strong>only the subcategories</strong> of the Recipe Category. The reason being that if you&#8217;re already in the Recipes section of the site, seeing a recipe labeled as Recipes is not helpful. However, seeing a recipe labeled as Dessert (mmm..) and Breakfast is helpful. So, each recipe that the client adds will be in a <strong>subcategory </strong>of recipes (ex. Dessert), but they won&#8217;t have to check off the checkbox next to the Recipes category itself.</p>
<p>Anyway, I&#8217;ve been looking for this solution for a long time and now, thanks to <a href="http://www.google.com/url?sa=t&amp;source=web&amp;ct=res&amp;cd=1&amp;url=http%3A%2F%2Fbitsofink.com%2F&amp;ei=YQtjSuS9MYaEmgOgvdT4Dw&amp;usg=AFQjCNG1logmg3Pto6eFPjwQ6fHtpve3Nw">Ilan Cohen</a>, I present it to you.</p>
<p>[Replace the number 5 with the parent category.]</p>
<blockquote><p>&lt;form method=&#8221;get&#8221; id=&#8221;searchform&#8221; action=&#8221;&lt;?php bloginfo(&#8216;home&#8217;); ?&gt;/&#8221;&gt;<br />
&lt;div id=&#8221;search&#8221;&gt;<br />
&lt;input type=&#8221;text&#8221; value=&#8221;Search&#8230; &#8221; onclick=&#8221;this.value=&#8221;;&#8221; name=&#8221;s&#8221; id=&#8221;s&#8221; /&gt;<br />
&lt;?php $categories = get_categories(&#8216;child_of=5&#8242;);<br />
$catlist = &#8221;;<br />
foreach ($categories as $cat) {<br />
$catlist.= $cat-&gt;cat_ID.&#8217;,';<br />
}<br />
$catlist.&#8217;5&#8242;;<br />
?&gt;<br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;cat&#8221; value=&#8221;&lt;?php echo &#8220;$catlist&#8221;?&gt;&#8221; /&gt;<br />
&lt;input name=&#8221;" type=&#8221;image&#8221; src=&#8221;&lt;?php bloginfo(&#8216;stylesheet_directory&#8217;); ?&gt;/styles/&lt;?php echo &#8220;$style_path&#8221;; ?&gt;/search.gif&#8221; value=&#8221;Go&#8221; class=&#8221;btn&#8221; /&gt;<br />
&lt;/div&gt;&lt;!&#8211;/search &#8211;&gt;<br />
&lt;/form&gt;</p></blockquote>
<p>The code searches through all the child categories of Category 5 (Recipes). Then, you&#8217;ll see we added an additional &#8220;5&#8243; in this line: $catlist.&#8217;5&#8242;; just in case the client puts a recipe in the Recipes category, and not one of its subcategories.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://wpgarage.com/code-snippets/how-to-hack-the-wordpress-search-function-search-categories-and-child-categories/&amp;title=How+to+Hack+the+Wordpress+Search+Function%3A+Search+Categories+and+Child+Categories" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://wpgarage.com/code-snippets/how-to-hack-the-wordpress-search-function-search-categories-and-child-categories/&amp;title=How+to+Hack+the+Wordpress+Search+Function%3A+Search+Categories+and+Child+Categories" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://wpgarage.com/code-snippets/how-to-hack-the-wordpress-search-function-search-categories-and-child-categories/&amp;title=How+to+Hack+the+Wordpress+Search+Function%3A+Search+Categories+and+Child+Categories&amp;desc=Recently%2C%20we%20had%20a%20client%20who%20wanted%20a%20special%20recipe%20search.%20There%20were%202%20ways%20to%20extend%20the%20search%20functionality%20-%20manually%20or%20dynamically.%0D%0A%0D%0A1.%20Search%20One%20or%20More%20Categories%20Manually%0D%0A%0D%0A%0D%0AIf%20we%20want%20to%20search%20one%20category%2C%20we%20could%20have%20used%20this%20solution%20which%20lets%20you%20manually%20add%20category%20num" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://wpgarage.com/code-snippets/how-to-hack-the-wordpress-search-function-search-categories-and-child-categories/&amp;t=How+to+Hack+the+Wordpress+Search+Function%3A+Search+Categories+and+Child+Categories" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-friendfeed">
			<a href="http://www.friendfeed.com/share?title=How+to+Hack+the+Wordpress+Search+Function%3A+Search+Categories+and+Child+Categories&amp;link=http://wpgarage.com/code-snippets/how-to-hack-the-wordpress-search-function-search-categories-and-child-categories/" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="shr-gmail">
			<a href="https://mail.google.com/mail/?ui=2&amp;view=cm&amp;fs=1&amp;tf=1&amp;su=How+to+Hack+the+Wordpress+Search+Function%3A+Search+Categories+and+Child+Categories&amp;body=Link: http://wpgarage.com/code-snippets/how-to-hack-the-wordpress-search-function-search-categories-and-child-categories/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A Recently%2C%20we%20had%20a%20client%20who%20wanted%20a%20special%20recipe%20search.%20There%20were%202%20ways%20to%20extend%20the%20search%20functionality%20-%20manually%20or%20dynamically.%0D%0A%0D%0A1.%20Search%20One%20or%20More%20Categories%20Manually%0D%0A%0D%0A%0D%0AIf%20we%20want%20to%20search%20one%20category%2C%20we%20could%20have%20used%20this%20solution%20which%20lets%20you%20manually%20add%20category%20num" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://wpgarage.com/code-snippets/how-to-hack-the-wordpress-search-function-search-categories-and-child-categories/&amp;title=How+to+Hack+the+Wordpress+Search+Function%3A+Search+Categories+and+Child+Categories" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://wpgarage.com/code-snippets/how-to-hack-the-wordpress-search-function-search-categories-and-child-categories/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-googlereader">
			<a href="http://www.google.com/reader/link?url=http://wpgarage.com/code-snippets/how-to-hack-the-wordpress-search-function-search-categories-and-child-categories/&amp;title=How+to+Hack+the+Wordpress+Search+Function%3A+Search+Categories+and+Child+Categories&amp;srcUrl=http://wpgarage.com/code-snippets/how-to-hack-the-wordpress-search-function-search-categories-and-child-categories/&amp;srcTitle=How+to+Hack+the+Wordpress+Search+Function%3A+Search+Categories+and+Child+Categories&amp;snippet=Recently%2C%20we%20had%20a%20client%20who%20wanted%20a%20special%20recipe%20search.%20There%20were%202%20ways%20to%20extend%20the%20search%20functionality%20-%20manually%20or%20dynamically.%0D%0A%0D%0A1.%20Search%20One%20or%20More%20Categories%20Manually%0D%0A%0D%0A%0D%0AIf%20we%20want%20to%20search%20one%20category%2C%20we%20could%20have%20used%20this%20solution%20which%20lets%20you%20manually%20add%20category%20num" rel="nofollow" class="external" title="Add this to Google Reader">Add this to Google Reader</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://wpgarage.com/code-snippets/how-to-hack-the-wordpress-search-function-search-categories-and-child-categories/&amp;title=How+to+Hack+the+Wordpress+Search+Function%3A+Search+Categories+and+Child+Categories&amp;summary=Recently%2C%20we%20had%20a%20client%20who%20wanted%20a%20special%20recipe%20search.%20There%20were%202%20ways%20to%20extend%20the%20search%20functionality%20-%20manually%20or%20dynamically.%0D%0A%0D%0A1.%20Search%20One%20or%20More%20Categories%20Manually%0D%0A%0D%0A%0D%0AIf%20we%20want%20to%20search%20one%20category%2C%20we%20could%20have%20used%20this%20solution%20which%20lets%20you%20manually%20add%20category%20num&amp;source=WP Garage" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-netvibes">
			<a href="http://www.netvibes.com/share?title=How+to+Hack+the+Wordpress+Search+Function%3A+Search+Categories+and+Child+Categories&amp;url=http://wpgarage.com/code-snippets/how-to-hack-the-wordpress-search-function-search-categories-and-child-categories/" rel="nofollow" class="external" title="Submit this to Netvibes">Submit this to Netvibes</a>
		</li>
		<li class="shr-posterous">
			<a href="http://posterous.com/share?linkto=http://wpgarage.com/code-snippets/how-to-hack-the-wordpress-search-function-search-categories-and-child-categories/&amp;title=How+to+Hack+the+Wordpress+Search+Function%3A+Search+Categories+and+Child+Categories&amp;selection=Recently%2C%20we%20had%20a%20client%20who%20wanted%20a%20special%20recipe%20search.%20There%20were%202%20ways%20to%20extend%20the%20search%20functionality%20-%20manually%20or%20dynamically.%0D%0A%0D%0A1.%20Search%20One%20or%20More%20Categories%20Manually%0D%0A%0D%0A%0D%0AIf%20we%20want%20to%20search%20one%20category%2C%20we%20could%20have%20used%20this%20solution%20which%20lets%20you%20manually%20add%20category%20num" rel="nofollow" class="external" title="Post this to Posterous">Post this to Posterous</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://wpgarage.com/code-snippets/how-to-hack-the-wordpress-search-function-search-categories-and-child-categories/&amp;title=How+to+Hack+the+Wordpress+Search+Function%3A+Search+Categories+and+Child+Categories" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-slashdot">
			<a href="http://slashdot.org/bookmark.pl?url=http://wpgarage.com/code-snippets/how-to-hack-the-wordpress-search-function-search-categories-and-child-categories/&amp;title=How+to+Hack+the+Wordpress+Search+Function%3A+Search+Categories+and+Child+Categories" rel="nofollow" class="external" title="Submit this to SlashDot">Submit this to SlashDot</a>
		</li>
		<li class="shr-sphinn">
			<a href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http://wpgarage.com/code-snippets/how-to-hack-the-wordpress-search-function-search-categories-and-child-categories/" rel="nofollow" class="external" title="Sphinn this on Sphinn">Sphinn this on Sphinn</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://wpgarage.com/code-snippets/how-to-hack-the-wordpress-search-function-search-categories-and-child-categories/&amp;title=How+to+Hack+the+Wordpress+Search+Function%3A+Search+Categories+and+Child+Categories" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-techmeme">
			<a href="http://twitter.com/home/?status=Tip+@Techmeme+http://wpgarage.com/code-snippets/how-to-hack-the-wordpress-search-function-search-categories-and-child-categories/+&quot;How+to+Hack+the+Wordpress+Search+Function%3A+Search+Categories+and+Child+Categories&quot;&amp;source=shareaholic" rel="nofollow" class="external" title="Tip this to TechMeme">Tip this to TechMeme</a>
		</li>
		<li class="shr-tumblr">
			<a href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fwpgarage.com%2Fcode-snippets%2Fhow-to-hack-the-wordpress-search-function-search-categories-and-child-categories%2F&amp;t=How+to+Hack+the+Wordpress+Search+Function%3A+Search+Categories+and+Child+Categories" rel="nofollow" class="external" title="Share this on Tumblr">Share this on Tumblr</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=How+to+Hack+the+Wordpress+Search+Function%3A+Search+Categories+and+Child+Categorie%5B..%5D+-++%28via+%40wpgarage%29&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22How%20to%20Hack%20the%20Wordpress%20Search%20Function%3A%20Search%20Categories%20and%20Child%20Categories%22&amp;body=Link: http://wpgarage.com/code-snippets/how-to-hack-the-wordpress-search-function-search-categories-and-child-categories/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A Recently%2C%20we%20had%20a%20client%20who%20wanted%20a%20special%20recipe%20search.%20There%20were%202%20ways%20to%20extend%20the%20search%20functionality%20-%20manually%20or%20dynamically.%0D%0A%0D%0A1.%20Search%20One%20or%20More%20Categories%20Manually%0D%0A%0D%0A%0D%0AIf%20we%20want%20to%20search%20one%20category%2C%20we%20could%20have%20used%20this%20solution%20which%20lets%20you%20manually%20add%20category%20num" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
		<li class="shr-printfriendly">
			<a href="http://www.printfriendly.com/print?url=http://wpgarage.com/code-snippets/how-to-hack-the-wordpress-search-function-search-categories-and-child-categories/" rel="nofollow" class="external" title="Send this page to Print Friendly">Send this page to Print Friendly</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://wpgarage.com/code-snippets/how-to-hack-the-wordpress-search-function-search-categories-and-child-categories/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>How to create a Simple Directory in WordPress using Grandparent, Parent, and Child Pages</title>
		<link>http://wpgarage.com/code-snippets/how-to-create-a-simple-directory-in-wordpress-using-grandparent-parent-and-child-pages/</link>
		<comments>http://wpgarage.com/code-snippets/how-to-create-a-simple-directory-in-wordpress-using-grandparent-parent-and-child-pages/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 10:04:13 +0000</pubDate>
		<dc:creator>Rebecca Markowitz</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[child]]></category>
		<category><![CDATA[directory]]></category>
		<category><![CDATA[grandparent]]></category>
		<category><![CDATA[Pages]]></category>
		<category><![CDATA[parent]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://wordpressgarage.com/?p=464</guid>
		<description><![CDATA[I wanted to create a simple directory of non-profit organizations. To do so,  I wanted to use pages for the directory, rather than posts so that I could separate the static directory listings from the dynamic blog posts. I didn&#8217;t want to have to exclude tons of categories from feedburner and the main loop. So, [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to create a simple directory of non-profit organizations. To do so,   I wanted to use pages for the directory, rather than posts so that I could separate the static directory listings from the dynamic blog posts. I didn&#8217;t want to have to exclude tons of categories from feedburner and the main loop.</p>
<p>So, I started exploring the whole family in WordPress &#8211; grandparents, parents, and children. Translation for those not yet used to seeing WordPress analagous to the family in My Big Fat Greek Wedding: Pages, sub-pages, and sub-sub pages</p>
<p><strong>Simple Directory Setup<br />
</strong></p>
<ul>
<li>Directory Page (grandparent): Displays list of Non-Profit Organization Categories  (ex. social, environment, health, etc.)</li>
<li>Category Page (parent): Show title and excerpt of each Organization within a category (ex. Environment Organizations)</li>
<li>Single Organization Page (child/current): Show content about a single organization(ex.  SaveTheEarth &#8211; made up org for this example)</li>
</ul>
<p><strong>Here&#8217;s how to do it</strong></p>
<ol>
<li>Create a Page Called Directory. This will be the <strong>Directory Page</strong> (grandparent)</li>
<li>Find the Page ID. Let&#8217;s say the Page ID = 5. Depending on how you want to display the category info, you can</li>
<li> Manually add the name of each category, a short description and a link</li>
<li>Open up page.php so we can setup <strong>The Category Page</strong> (Parent Page). We want to show title and excerpts of each organization for each category.</li>
<li>Add this code to page.php &#8211; Checks if we&#8217;re on a sub page / child page of the Directory (Page ID =10) and if so, list the pages in alphabetical order with excerpts. For the excerpt, I&#8217;m using the plugin Limit Posts since it didn&#8217;t work with The Excerpt Reloaded.&lt;?php<br />
$current = $post-&gt;ID;<br />
$parent = $post-&gt;post_parent;<br />
$grandparent_get = get_post($parent);<br />
$grandparent = $grandparent_get-&gt;post_parent;<br />
?&gt;</p>
<p>&lt;?php if ( $post-&gt;post_parent==&#8221;10&#8243;   ){ ?&gt;<br />
&lt;?php $pageChildren = $wpdb-&gt;get_results(&#8220;SELECT *    FROM $wpdb-&gt;posts WHERE post_parent = &#8220;.$post-&gt;ID.&#8221;    AND post_type = &#8216;page&#8217; ORDER BY post_title ASC&#8221;, &#8216;OBJECT&#8217;);    ?&gt;</p>
<p>&lt;h2 class=&#8221;titles&#8221;&gt;&lt;a href=&#8221;&lt;? php echo get_permalink($pageChild-&gt;ID);  ?&gt;&#8221;&gt; &lt;? php echo $pageChild-&gt;post_title;  ?&gt;&lt;/a&gt;&lt;/h2&gt;</p>
<p>&lt;?php the_content_limit(280, &#8220;&#8221;); ?&gt;&lt;div class=&#8221;readmore&#8221;&gt;&lt;a href=&#8221;&lt;?php echo get_permalink($pageChild-&gt;ID); ?&gt;&#8221; rel=&#8221;bookmark&#8221; title=&#8221;Permanent Link to &lt;? php echo $pageChild-&gt;post_title;   ?&gt;&#8221;&gt;Read More &amp;raquo;&lt;/a&gt;&lt;/div&gt;</p>
<p>(make sure to delete the space between &lt;? and php -  I had to to do that so it wouldn&#8217;t execute in this post)</li>
<li><strong>Single Organization Page </strong>(Child Page) On page.php, after the code you added in step 5, add this code that will check to see if we&#8217;re on the grandchild page. This will be the actual organization&#8217;s page. In our example, the SaveTheEarth Page. This is very helpful information in case you want to add a different style or add special items in the sidebar, etc.<br />
&lt;?php if ( $pageChildren ) : foreach ( $pageChildren as $pageChild ) : setup_postdata( $pageChild ); ?&gt;</li>
</ol>
<p style="padding-left: 30px;">7. Set up how the rest of the pages on your site will look:</p>
<p style="padding-left: 30px;">On page.php, after the code in step 6, add this code which instructs every other page in the site to act normally and display the content</p>
<p style="padding-left: 30px;">&lt;?php endforeach; ?&gt;<br />
&lt;?php else : ?&gt;</p>
<p style="padding-left: 30px;">&lt;?php the_content(); ?&gt;<br />
&lt;?php  endif; ?&gt;</p>
<p style="padding-left: 30px;">
<p><strong>You can see the full page.php code <a href="http://wpgarage.com/wp-content/uploads/2009/06/page.txt">here</a></strong></p>
<p><strong>You can see the directory in action <a href="http://israelnonprofitnews.com/directory/">here</a><br />
</strong></p>
<p>I figured this out using the following helpful posts:</p>
<p>*<a href="http://wordpress.org/support/topic/186206"> http://wordpress.org/support/topic/186206</a><br />
* <a href="http://wpguru.co.za/page/display-title-excerpt-of-child-page">http://wpguru.co.za/page/display-title-excerpt-of-child-page</a></p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://wpgarage.com/code-snippets/how-to-create-a-simple-directory-in-wordpress-using-grandparent-parent-and-child-pages/&amp;title=How+to+create+a+Simple+Directory+in+Wordpress+using+Grandparent%2C+Parent%2C+and+Child+Pages" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://wpgarage.com/code-snippets/how-to-create-a-simple-directory-in-wordpress-using-grandparent-parent-and-child-pages/&amp;title=How+to+create+a+Simple+Directory+in+Wordpress+using+Grandparent%2C+Parent%2C+and+Child+Pages" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://wpgarage.com/code-snippets/how-to-create-a-simple-directory-in-wordpress-using-grandparent-parent-and-child-pages/&amp;title=How+to+create+a+Simple+Directory+in+Wordpress+using+Grandparent%2C+Parent%2C+and+Child+Pages&amp;desc=I%20wanted%20to%20create%20a%20simple%20directory%20of%20non-profit%20organizations.%20To%20do%20so%2C%C2%A0%20%20I%20wanted%20to%20use%20pages%20for%20the%20directory%2C%20rather%20than%20posts%20so%20that%20I%20could%20separate%20the%20static%20directory%20listings%20from%20the%20dynamic%20blog%20posts.%20I%20didn%27t%20want%20to%20have%20to%20exclude%20tons%20of%20categories%20from%20feedburner%20and%20the%20m" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://wpgarage.com/code-snippets/how-to-create-a-simple-directory-in-wordpress-using-grandparent-parent-and-child-pages/&amp;t=How+to+create+a+Simple+Directory+in+Wordpress+using+Grandparent%2C+Parent%2C+and+Child+Pages" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-friendfeed">
			<a href="http://www.friendfeed.com/share?title=How+to+create+a+Simple+Directory+in+Wordpress+using+Grandparent%2C+Parent%2C+and+Child+Pages&amp;link=http://wpgarage.com/code-snippets/how-to-create-a-simple-directory-in-wordpress-using-grandparent-parent-and-child-pages/" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="shr-gmail">
			<a href="https://mail.google.com/mail/?ui=2&amp;view=cm&amp;fs=1&amp;tf=1&amp;su=How+to+create+a+Simple+Directory+in+Wordpress+using+Grandparent%2C+Parent%2C+and+Child+Pages&amp;body=Link: http://wpgarage.com/code-snippets/how-to-create-a-simple-directory-in-wordpress-using-grandparent-parent-and-child-pages/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A I%20wanted%20to%20create%20a%20simple%20directory%20of%20non-profit%20organizations.%20To%20do%20so%2C%C2%A0%20%20I%20wanted%20to%20use%20pages%20for%20the%20directory%2C%20rather%20than%20posts%20so%20that%20I%20could%20separate%20the%20static%20directory%20listings%20from%20the%20dynamic%20blog%20posts.%20I%20didn%27t%20want%20to%20have%20to%20exclude%20tons%20of%20categories%20from%20feedburner%20and%20the%20m" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://wpgarage.com/code-snippets/how-to-create-a-simple-directory-in-wordpress-using-grandparent-parent-and-child-pages/&amp;title=How+to+create+a+Simple+Directory+in+Wordpress+using+Grandparent%2C+Parent%2C+and+Child+Pages" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://wpgarage.com/code-snippets/how-to-create-a-simple-directory-in-wordpress-using-grandparent-parent-and-child-pages/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-googlereader">
			<a href="http://www.google.com/reader/link?url=http://wpgarage.com/code-snippets/how-to-create-a-simple-directory-in-wordpress-using-grandparent-parent-and-child-pages/&amp;title=How+to+create+a+Simple+Directory+in+Wordpress+using+Grandparent%2C+Parent%2C+and+Child+Pages&amp;srcUrl=http://wpgarage.com/code-snippets/how-to-create-a-simple-directory-in-wordpress-using-grandparent-parent-and-child-pages/&amp;srcTitle=How+to+create+a+Simple+Directory+in+Wordpress+using+Grandparent%2C+Parent%2C+and+Child+Pages&amp;snippet=I%20wanted%20to%20create%20a%20simple%20directory%20of%20non-profit%20organizations.%20To%20do%20so%2C%C2%A0%20%20I%20wanted%20to%20use%20pages%20for%20the%20directory%2C%20rather%20than%20posts%20so%20that%20I%20could%20separate%20the%20static%20directory%20listings%20from%20the%20dynamic%20blog%20posts.%20I%20didn%27t%20want%20to%20have%20to%20exclude%20tons%20of%20categories%20from%20feedburner%20and%20the%20m" rel="nofollow" class="external" title="Add this to Google Reader">Add this to Google Reader</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://wpgarage.com/code-snippets/how-to-create-a-simple-directory-in-wordpress-using-grandparent-parent-and-child-pages/&amp;title=How+to+create+a+Simple+Directory+in+Wordpress+using+Grandparent%2C+Parent%2C+and+Child+Pages&amp;summary=I%20wanted%20to%20create%20a%20simple%20directory%20of%20non-profit%20organizations.%20To%20do%20so%2C%C2%A0%20%20I%20wanted%20to%20use%20pages%20for%20the%20directory%2C%20rather%20than%20posts%20so%20that%20I%20could%20separate%20the%20static%20directory%20listings%20from%20the%20dynamic%20blog%20posts.%20I%20didn%27t%20want%20to%20have%20to%20exclude%20tons%20of%20categories%20from%20feedburner%20and%20the%20m&amp;source=WP Garage" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-netvibes">
			<a href="http://www.netvibes.com/share?title=How+to+create+a+Simple+Directory+in+Wordpress+using+Grandparent%2C+Parent%2C+and+Child+Pages&amp;url=http://wpgarage.com/code-snippets/how-to-create-a-simple-directory-in-wordpress-using-grandparent-parent-and-child-pages/" rel="nofollow" class="external" title="Submit this to Netvibes">Submit this to Netvibes</a>
		</li>
		<li class="shr-posterous">
			<a href="http://posterous.com/share?linkto=http://wpgarage.com/code-snippets/how-to-create-a-simple-directory-in-wordpress-using-grandparent-parent-and-child-pages/&amp;title=How+to+create+a+Simple+Directory+in+Wordpress+using+Grandparent%2C+Parent%2C+and+Child+Pages&amp;selection=I%20wanted%20to%20create%20a%20simple%20directory%20of%20non-profit%20organizations.%20To%20do%20so%2C%C2%A0%20%20I%20wanted%20to%20use%20pages%20for%20the%20directory%2C%20rather%20than%20posts%20so%20that%20I%20could%20separate%20the%20static%20directory%20listings%20from%20the%20dynamic%20blog%20posts.%20I%20didn%27t%20want%20to%20have%20to%20exclude%20tons%20of%20categories%20from%20feedburner%20and%20the%20m" rel="nofollow" class="external" title="Post this to Posterous">Post this to Posterous</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://wpgarage.com/code-snippets/how-to-create-a-simple-directory-in-wordpress-using-grandparent-parent-and-child-pages/&amp;title=How+to+create+a+Simple+Directory+in+Wordpress+using+Grandparent%2C+Parent%2C+and+Child+Pages" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-slashdot">
			<a href="http://slashdot.org/bookmark.pl?url=http://wpgarage.com/code-snippets/how-to-create-a-simple-directory-in-wordpress-using-grandparent-parent-and-child-pages/&amp;title=How+to+create+a+Simple+Directory+in+Wordpress+using+Grandparent%2C+Parent%2C+and+Child+Pages" rel="nofollow" class="external" title="Submit this to SlashDot">Submit this to SlashDot</a>
		</li>
		<li class="shr-sphinn">
			<a href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http://wpgarage.com/code-snippets/how-to-create-a-simple-directory-in-wordpress-using-grandparent-parent-and-child-pages/" rel="nofollow" class="external" title="Sphinn this on Sphinn">Sphinn this on Sphinn</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://wpgarage.com/code-snippets/how-to-create-a-simple-directory-in-wordpress-using-grandparent-parent-and-child-pages/&amp;title=How+to+create+a+Simple+Directory+in+Wordpress+using+Grandparent%2C+Parent%2C+and+Child+Pages" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-techmeme">
			<a href="http://twitter.com/home/?status=Tip+@Techmeme+http://wpgarage.com/code-snippets/how-to-create-a-simple-directory-in-wordpress-using-grandparent-parent-and-child-pages/+&quot;How+to+create+a+Simple+Directory+in+Wordpress+using+Grandparent%2C+Parent%2C+and+Child+Pages&quot;&amp;source=shareaholic" rel="nofollow" class="external" title="Tip this to TechMeme">Tip this to TechMeme</a>
		</li>
		<li class="shr-tumblr">
			<a href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fwpgarage.com%2Fcode-snippets%2Fhow-to-create-a-simple-directory-in-wordpress-using-grandparent-parent-and-child-pages%2F&amp;t=How+to+create+a+Simple+Directory+in+Wordpress+using+Grandparent%2C+Parent%2C+and+Child+Pages" rel="nofollow" class="external" title="Share this on Tumblr">Share this on Tumblr</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=How+to+create+a+Simple+Directory+in+Wordpress+using+Grandparent%2C+Parent%2C+and+Chi%5B..%5D+-++%28via+%40wpgarage%29&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22How%20to%20create%20a%20Simple%20Directory%20in%20Wordpress%20using%20Grandparent%2C%20Parent%2C%20and%20Child%20Pages%22&amp;body=Link: http://wpgarage.com/code-snippets/how-to-create-a-simple-directory-in-wordpress-using-grandparent-parent-and-child-pages/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A I%20wanted%20to%20create%20a%20simple%20directory%20of%20non-profit%20organizations.%20To%20do%20so%2C%C2%A0%20%20I%20wanted%20to%20use%20pages%20for%20the%20directory%2C%20rather%20than%20posts%20so%20that%20I%20could%20separate%20the%20static%20directory%20listings%20from%20the%20dynamic%20blog%20posts.%20I%20didn%27t%20want%20to%20have%20to%20exclude%20tons%20of%20categories%20from%20feedburner%20and%20the%20m" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
		<li class="shr-printfriendly">
			<a href="http://www.printfriendly.com/print?url=http://wpgarage.com/code-snippets/how-to-create-a-simple-directory-in-wordpress-using-grandparent-parent-and-child-pages/" rel="nofollow" class="external" title="Send this page to Print Friendly">Send this page to Print Friendly</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://wpgarage.com/code-snippets/how-to-create-a-simple-directory-in-wordpress-using-grandparent-parent-and-child-pages/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
