<?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>NPSites.com &#187; Wordpress Tips</title>
	<atom:link href="http://www.npsites.com/category/howtos/wordpress-tips/feed" rel="self" type="application/rss+xml" />
	<link>http://www.npsites.com</link>
	<description>NPSites.com</description>
	<lastBuildDate>Wed, 25 Jan 2012 00:38:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>HowTo Disallow Webbots For WordPress</title>
		<link>http://www.npsites.com/32/howto-disallow-webbots-for-wordpress.html</link>
		<comments>http://www.npsites.com/32/howto-disallow-webbots-for-wordpress.html#comments</comments>
		<pubDate>Fri, 02 Jan 2009 05:28:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Site Management]]></category>
		<category><![CDATA[Wordpress Tips]]></category>

		<guid isPermaLink="false">http://htmlguide.npsites.com/?p=32</guid>
		<description><![CDATA[For any website administrator it is important to regulate how search engine robots suck the life out of your site. While it is important to consider .htaccess for password protecting and leaching of images simply inserting a robots.txt file can reduce a lot of load on your site. This is very important for administrators who use [...]]]></description>
			<content:encoded><![CDATA[<p>For any website administrator it is important to regulate how search engine robots suck the life out of your site. While it is important to consider .htaccess for password protecting and leaching of images simply inserting a robots.txt file can reduce a lot of load on your site.</p>
<p>This is very important for administrators who use Amazon Webstores and for anyone that feeds their content off of remote xml data. If the generation of your sites pages can be unlimited based on an external data resource you should examine more indepth ways to restrict access to any bot.</p>
<p>For WordPress users you want to restrict access to files and directories that are not part of your site. You may also want to restrict access to your images and cache files.</p>
<p>A basic WordPress robots.txt file could include the following:</p>
<p>Notice User Agent * is all&#8230;. and that disallows are at the top<br />
followed by overrides for Google AdSense.<br />
An included badbot is also banned based on their user agent info found in the webserver logs.</p>
<div style="border: 1px solid #000000; margin: 5px; padding: 5px; font-size: 9px; width: 450px; line-height: 10px;">User-agent: *<br />
Disallow: /cgi-bin<br />
Disallow: /wp-admin<br />
Disallow: /wp-includes<br />
Disallow: /wp-content/plugins<br />
Disallow: /wp-content/cache<br />
Disallow: /wp-content/themes<br />
Disallow: /trackback<br />
Disallow: /feed<br />
Disallow: /comments<br />
Disallow: /category/*/*<br />
Disallow: */trackback<br />
Disallow: */feed<br />
Disallow: */comments<br />
Disallow: /*?*<br />
Disallow: /*?<br />
Allow: /wp-content/uploads</p>
<p># Google AdSense<br />
User-agent: Mediapartners-Google*<br />
Disallow:<br />
Allow: /*</p>
<p># BadBot found in my logs<br />
User-agent: badbot<br />
Disallow: /</p></div>
<p>Remember that a robots.txt file is only as good as the bot that reads it.<br />
If someone is using wget to grab your site or a bot designed to harvest emails and links you are better off stopping it with script level denial, .htaccess or firewall commands.</p>
<p>If your site is getting hammered then contact your Service provider for help.</p>
<p>This info is just for reducing unneeded or unnecessary load by having bots run around in circles not finding what they should be looking for.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.npsites.com/32/howto-disallow-webbots-for-wordpress.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress &#8211; Software Developers Gathering Info About Your Site?</title>
		<link>http://www.npsites.com/53/wordpress-software-developers-gathering-info-about-your-site.html</link>
		<comments>http://www.npsites.com/53/wordpress-software-developers-gathering-info-about-your-site.html#comments</comments>
		<pubDate>Thu, 22 Jan 2009 10:54:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Wordpress Tips]]></category>

		<guid isPermaLink="false">http://htmlguide.npsites.com/?p=53</guid>
		<description><![CDATA[It seems there is a new fad in Open Source Software development where authors of Plugins have begun gathering statistics about websites that use their software. Most of the products showing this feature include freeware but there are a number of coders that want to make some cash off their hard work and registration or [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-86" title="wordpress_logo" src="http://www.npsites.com/npsblog/wp-content/uploads/2009/01/wordpress_logo.jpg" alt="wordpress_logo" width="150" height="39" />It seems there is a new fad in Open Source Software development where authors of Plugins have begun gathering statistics about websites that use their software.</p>
<p>Most of the products showing this feature include freeware but there are a number of coders that want to make some cash off their hard work and registration or stat gathering is one way they know who where when of sites that use their plugins.</p>
<p>Harvesting of information including the registered email, IP , Site Name and domain along with real time stats for every instance of the plugin being run. Meaning they know where your site is and what your visitor stats are.</p>
<p>Some authors just want their users to register and require your email.</p>
<p>Others are going a little too far it seems.</p>
<p>Site statistics are both private and internal information that no professional website owner wants to give away. These statistics can be used for marketing of advertising and they are never disclosed anonymously.</p>
<p>So, What will happen with this new fad?</p>
<p>Hopefully it will end or be monitored by the core software designers.</p>
<p>More importantly since WordPress has moved to internal automatic updates some of this software could be installed without prior notice.</p>
<p>This would be an atrocious breach of confidence between users and developers and it could mean problems down the road.</p>
<p>So Keep Your Eyes open because someone may be watching your site from the inside.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.npsites.com/53/wordpress-software-developers-gathering-info-about-your-site.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HowTo &#8211; Improving Your Web Rank With Sociable WordPress Plugin</title>
		<link>http://www.npsites.com/103/howto-improving-your-web-rank-with-sociable-wordpress-plugin.html</link>
		<comments>http://www.npsites.com/103/howto-improving-your-web-rank-with-sociable-wordpress-plugin.html#comments</comments>
		<pubDate>Wed, 04 Feb 2009 17:21:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[SEO & Advertising]]></category>
		<category><![CDATA[Wordpress Tips]]></category>

		<guid isPermaLink="false">http://www.npsites.com/?p=103</guid>
		<description><![CDATA[As content developers we are always trying to find ways to attract visitors to our pages. One of the nice ways we can do this is by giving our visitors the ability to quickly post backlinks and announcements on social and directory networks when they like what they have read. This is where the Sociable [...]]]></description>
			<content:encoded><![CDATA[<p>As content developers we are always trying to find ways to attract visitors to our pages.</p>
<p>One of the nice ways we can do this is by giving our visitors the ability to quickly post backlinks and announcements on social and directory networks when they like what they have read. This is where the Sociable Plugin for WordPress really shines.</p>
<p>With about 100 optional sites you can insert links to all of the popular social networks. When a visitor who belongs to one of these sites wants to give your post a bump they click on the icon and are taken to the social network with predefined fields and urls all ready to be submitted.</p>
<p>If you know of a site that isn&#8217;t on the list its not that hard to add them. Just find an appropriate ico file for the site and enter all the appropriate information in the plugin code.</p>
<p>The plugin will automatically insert the list you select on the bottom of your posts but you can use php within your post loop to place the button bar where you like it.</p>
<p>Sociable is free to use but considering all of the hours that went into finding and setting up the code (try to add a couple buttons manually and you will see) its cool if you send the author a donation so they can keep updating the code.</p>
<p>In wordpress 2.7 or higher you can install from your plugin settings page or you can visit</p>
<p>http://wordpress.org/extend/plugins/</p>
<p>Author: Joost de Valk</p>
<p>http://yoast.com/</p>
]]></content:encoded>
			<wfw:commentRss>http://www.npsites.com/103/howto-improving-your-web-rank-with-sociable-wordpress-plugin.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HowTo &#8211; Controlling Revisions In WordPress</title>
		<link>http://www.npsites.com/123/howto-controlling-revisions-in-wordpress.html</link>
		<comments>http://www.npsites.com/123/howto-controlling-revisions-in-wordpress.html#comments</comments>
		<pubDate>Fri, 06 Feb 2009 22:34:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Wordpress Tips]]></category>

		<guid isPermaLink="false">http://www.npsites.com/?p=123</guid>
		<description><![CDATA[Anyone that has upgraded their wordpress install past 2.6 has found their database grow to extreme size due to the autosave and revisions that are generated and practically undeletable. Shouldn&#8217;t there be an option so the admin for the site can dump these posts? Well it seems that the core developers believe everyone wants to [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-86" title="wordpress_logo" src="http://www.npsites.com/npsblog/wp-content/uploads/2009/01/wordpress_logo.jpg" alt="wordpress_logo" width="150" height="39" />Anyone that has upgraded their wordpress install past 2.6 has found their database grow to extreme size due to the autosave and revisions that are generated and practically undeletable.</p>
<p>Shouldn&#8217;t there be an option so the admin for the site can dump these posts?</p>
<p>Well it seems that the core developers believe everyone wants to have 5 backups of every post but with 2.8 about to be released maybe we should send them copies of all our useless revisions by email&#8230;. maybe they can find a useful reason to save them.</p>
<p>Does this sound like a little bit of a rant well yea maybe but if a feature could increase your database by 30% its reasonable for core developers to be forthcoming and alert us to the way to turn it off and clean the useless data out before we do an upgrade or install.</p>
<p>Anyway there is a partial cure.</p>
<p><strong>The Revision Control Plugin</strong> that was so nicely <strong>created by  Dion Hulse</strong> will allow you to set revisions to a reasonable number or disable them completely. (Which is what I do)</p>
<p>Download it as fast as you can and install it. Then make the appropriate settings in the plugin features page.</p>
<p><a href="http://wordpress.org/extend/plugins/revision-control/" target="_blank">http://wordpress.org/extend/plugins/revision-control/</a></p>
<p>Dion seems to write a lot of code related to every day problems that many WordPress site admins have.  This is a dedicated thing to do and I hope that someone in the core developer team takes note when developers spend hours fixing bugs or adding what could be considered mandatory features that have been left out of major releases.</p>
<p>Visit Dion&#8217;s Website <a href="http://dd32.id.au/" target="_blank">http://dd32.id.au/</a></p>
<p>You are sure to learn a few things about wordpress that you never knew before.</p>
<p>It is also possible to turn off revisions completely by placing this line in your wp-config file but this means you can&#8217;t have control of the feature within wordpress.</p>
<pre class="php" style="font-family: monospace;"><span style="color: #990000;">define</span> <span style="color: #009900;">(</span><span style="color: #0000ff;">'WP_POST_REVISIONS'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span>    <span style="color: #666666; font-style: italic;">//  TURN OFF POST REVISIONS.</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.npsites.com/123/howto-controlling-revisions-in-wordpress.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HowTo &#8211; Slowing The DAM Autosave Interval In WordPress</title>
		<link>http://www.npsites.com/124/howto-slowing-the-dam-autosave-interval-in-wordpress.html</link>
		<comments>http://www.npsites.com/124/howto-slowing-the-dam-autosave-interval-in-wordpress.html#comments</comments>
		<pubDate>Sat, 07 Feb 2009 20:56:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Wordpress Tips]]></category>

		<guid isPermaLink="false">http://www.npsites.com/?p=124</guid>
		<description><![CDATA[Have you tried to spell check your posts in WordPress lately? Yea if you are like me and everyone else trying to deal with inserting images, making selections or even just spell checking got a lot harder after someone cranked up the autosave interval so high that it seems you can&#8217;t type more then a [...]]]></description>
			<content:encoded><![CDATA[<p>Have you tried to spell check your posts in WordPress lately?</p>
<p>Yea if you are like me and everyone else trying to deal with inserting images, making selections or even just spell checking got a lot harder after someone cranked up the autosave interval so high that it seems you can&#8217;t type more then a paragraph without it fireing off another autosave.</p>
<p>Well there is a way to increase the time between saves.</p>
<p>Open your wp-settings.php file and search for the word &#8220;save&#8221;</p>
<p>You will find a line of php to edit that looks like this.</p>
<p><span style="color: #ff0000;">/**<br />
* It is possible to define this in wp-config.php<br />
* @since 2.5.0<br />
*/<br />
if ( !defined( &#8216;AUTOSAVE_INTERVAL&#8217; ) )<br />
define( &#8216;AUTOSAVE_INTERVAL&#8217;, <span style="color: #0000ff;">60 </span>);</span></p>
<p>What you need to do is increase the 60 to 600 .</p>
<p>The time is suppose to be in seconds but either there are other events that fire off an autosave or this calculation of seconds must be off.</p>
<p>Anyway if you want autosaves to happen more often you might find a lower number is better for you.</p>
<p>The comment in the wp-settings.php file says it is posible to set this in your config file but I have not had luck doing that although it could have been because I had an active post being edited.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.npsites.com/124/howto-slowing-the-dam-autosave-interval-in-wordpress.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HowTo &#8211; Sending Mail Within WordPress</title>
		<link>http://www.npsites.com/127/howto-sending-mail-within-wordpress.html</link>
		<comments>http://www.npsites.com/127/howto-sending-mail-within-wordpress.html#comments</comments>
		<pubDate>Tue, 10 Feb 2009 22:58:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Wordpress Tips]]></category>

		<guid isPermaLink="false">http://www.npsites.com/?p=127</guid>
		<description><![CDATA[There are times when you need mail if you are writing or altering a plugin or maybe you have a special feature you are adding. Heck maybe you want to hook into the login and get an email everytime someone logs in&#8230; Hey thats not a bad idea .. Well instead of writing your own [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-86" title="wordpress_logo" src="http://www.npsites.com/npsblog/wp-content/uploads/2009/01/wordpress_logo.jpg" alt="wordpress_logo" width="150" height="39" />There are times when you need mail if you are writing or altering a plugin or maybe you have a special feature you are adding. Heck maybe you want to hook into the login and get an email everytime someone logs in&#8230;</p>
<p>Hey thats not a bad idea ..</p>
<p>Well instead of writing your own php mailer or using someone elses code you can do it through WordPress with wp_mail</p>
<p>The function is pretty straight forward with only a few options that need to be filled in to work.</p>
<h2>Parameters</h2>
<p><strong>$to</strong><br />
(string) (required) The intended recipient(s) of the message.</p>
<p>Default: None</p>
<p><strong>$subject</strong><br />
(string) (required) The subject of the message.</p>
<p>Default: None</p>
<p><strong>$message</strong><br />
(string) (required) Message content.</p>
<p>Default: None</p>
<p><strong>$headers</strong><br />
(string) (optional) Mail headers to send with the message (advanced)</p>
<p>Default: Empty</p>
<h2>Usage</h2>
<p>&lt;?php wp_mail($to, $subject, $message, $headers = ); ?&gt;</p>
<p>Remember to use clean vars</p>
]]></content:encoded>
			<wfw:commentRss>http://www.npsites.com/127/howto-sending-mail-within-wordpress.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HowTo &#8211; Last.Fm Records WordPress Plugin Widget</title>
		<link>http://www.npsites.com/128/howto-lastfm-records-wordpress-plugin-widget.html</link>
		<comments>http://www.npsites.com/128/howto-lastfm-records-wordpress-plugin-widget.html#comments</comments>
		<pubDate>Wed, 11 Feb 2009 15:59:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Wordpress Tips]]></category>

		<guid isPermaLink="false">http://www.npsites.com/?p=128</guid>
		<description><![CDATA[Recently while helping someone setup a site I had a chance to work with the Last.Fm Plugin written by Jeroen Smeets. The idea of the plugin is to allow you to put a sidebar widget of your Loved and favorited songs that you listen to on Last.fm To enable the plugin you need an account [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-86" title="wordpress_logo" src="http://www.npsites.com/npsblog/wp-content/uploads/2009/01/wordpress_logo.jpg" alt="wordpress_logo" width="150" height="39" />Recently while helping someone setup a site I had a chance to work with the Last.Fm Plugin written by Jeroen Smeets.</p>
<p>The idea of the plugin is to allow you to put a sidebar widget of your Loved and favorited songs that you listen to on Last.fm</p>
<p>To enable the plugin you need an account on Last.fm and you need to set values in your account to populate the widget. For instance if you wanted to show all the songs that you have selected as Loved you need to do that in your last.fm account and then select that option in the plugin options page.</p>
<p>Once you setup what images from songs you listen to you want displayed on your sidebar you can select the widget from your Appearance / Widgets setup and drag it where you want it to be or you can insert the PHP code to call the widget where ever you might want it on your page.</p>
<p>You might want to place it on your home.php front page or in a categories page and you would insert it using the following.</p>
<p><strong><code>&lt;?php lastfmrecords_display(); ?&gt;</code></strong></p>
<p>The major drawback we found that can be overcome in a new version or with some heavy editing by the enduser is that you can not display a few of these widgets to have a Loved and Recent  widget displayed.</p>
<p>We also had some problems with our permalinks hooking to Last.fm.</p>
<p>To overcome this you will need to edit the php of the widget and alter all of the references to how the plugin loads the widget and the options page by renaming constants.</p>
<p>It can be done but its not fun.</p>
<p>Other then that it seems to work pretty well and will automatically update your wordpress site when you are adding songs in last.fm</p>
<p><strong>If you need something like this visit</strong></p>
<p><a href="http://wordpress.org/extend/plugins/lastfm-records/" target="_blank">http://wordpress.org/extend/plugins/lastfm-records/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.npsites.com/128/howto-lastfm-records-wordpress-plugin-widget.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HowTo &#8211; WordPress 2.7 to 2.7.1 One Click Auto Upgrade Test Results</title>
		<link>http://www.npsites.com/133/howto-wordpress-27-to-271-one-click-auto-upgrade-test-results.html</link>
		<comments>http://www.npsites.com/133/howto-wordpress-27-to-271-one-click-auto-upgrade-test-results.html#comments</comments>
		<pubDate>Thu, 12 Feb 2009 08:44:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Wordpress Tips]]></category>

		<guid isPermaLink="false">http://www.npsites.com/?p=133</guid>
		<description><![CDATA[Well with a handful of WordPress sites to manage it can often take a night to upgrade them all when a new version comes out. Considering we like most users who might find this something more annoying then useful when most of the updates are simply fixes that are not contributing negatively to the function [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-86" title="wordpress_logo" src="http://www.npsites.com/npsblog/wp-content/uploads/2009/01/wordpress_logo.jpg" alt="wordpress_logo" width="150" height="39" />Well with a handful of WordPress sites to manage it can often take a night to upgrade them all when a new version comes out.</p>
<p>Considering we like most users who might find this something more annoying then useful when most of the updates are simply fixes that are not contributing negatively to the function of our site we tend to put off updates as long as possible.</p>
<p>With the introduction of Auto Updates for plugins&#8230; The WordPress Crew was really just getting us ready for 1 click updates to our core files.</p>
<p>This can be a pretty scary premise when you consider the number of files that are necessary for a wordpress install.</p>
<p>As of 2.7 the base install including the sample themes was a total of 603 files distributed within 76 directories. This is a fairly decent sized jump from only about 2 years ago when v2.0 had only about 340 files and half the directories. Sure function has increased but so has the time to manage the distribution.</p>
<p><strong>Test Results</strong><br />
In our test we had 5 sites to update. One of which was running 2.5 just a few weeks ago until we updated all our sites to 2.7.</p>
<p>The first thing we did before upgrading was backing up our databases.</p>
<p>This is a pretty simple process that can be done within cPanel, PhpMyAdmin or since we are on Windows for our desktops we use the MySql Administrator Gui ap.</p>
<p>After your db backups are complete you want to disable your WP-SuperCache and delete all the cached files not just the expired ones. This is just a matter of cleaning that you should do once in a while anyway.</p>
<p><strong>Backing Up Your Files</strong><br />
This really depends on your use of WordPress.</p>
<p>If you are accustom to using the Media Uploader then you should grab all your files by backing up your Uploads directory. You should also make backups of your wp-config.php file wp-settings.php file if you altered it and any other core or config file including your .htaccess file.</p>
<p>Next you should backup your wp-content directory for good measure especially if you are using the default theme and have made any changes to it. We actually forgot to check if AutoUpdate touches this file but while writing this .. if you use the default themes and have made changes to them &#8230; back them up.</p>
<p><strong>Now all you need to do is press the button</strong></p>
<p><strong>click</strong> &#8230;&#8230; la de da &#8230;..  WHAT HAVE I DONE&#8230; NOOOOOO!</p>
<p>no really each of the five live sites that we upgraded did just fine.</p>
<p>But it is a difficult choice to do this on a live site vs migrating files manually from your test server.</p>
<p><strong>After you test your site for function</strong> enable your cache and your plugins if needed and retest again by visiting all of your custom category and theme pages.</p>
<p>Remember to check all your plugins, menus and any function that you know you have edited.</p>
<p>Autoupdates are for live sites&#8230;. but if you are running a clustered server that gets 1,000 hits a minute you might think twice about it unless you can forward traffic completely away from your server through a dns setting until the process is over.</p>
<p>So, thats all for now&#8230; the first round of AutoUpdates have finally been put to the test.</p>
<p>We will probably talk in more detal about the process in other HowTos.</p>
<p>Share your comments about any problems you had we would like to hear them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.npsites.com/133/howto-wordpress-27-to-271-one-click-auto-upgrade-test-results.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HowTo &#8211; Using Query Posts To Display Posts In WordPress</title>
		<link>http://www.npsites.com/134/howto-using-query-posts-to-display-posts-in-wordpress.html</link>
		<comments>http://www.npsites.com/134/howto-using-query-posts-to-display-posts-in-wordpress.html#comments</comments>
		<pubDate>Thu, 12 Feb 2009 23:58:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Wordpress Tips]]></category>

		<guid isPermaLink="false">http://www.npsites.com/?p=134</guid>
		<description><![CDATA[When you add posts to your WordPress Blog by default if you haven&#8217;t made changes to your theme they are assigned a Post ID number that identifies that specific post. If you do nothing else they will be displayed in order of the newest to oldest in one single group. Because it is unfair or [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-86" title="wordpress_logo" src="http://www.npsites.com/npsblog/wp-content/uploads/2009/01/wordpress_logo.jpg" alt="wordpress_logo" width="150" height="39" />When you add posts to your WordPress Blog by default if you haven&#8217;t made changes to your theme they are assigned a Post ID number that identifies that specific post. If you do nothing else they will be displayed in order of the newest to oldest in one single group.</p>
<p>Because it is unfair or useless to expect your visitors to read through hundreds of posts to find something you wrote about your pet iguana 3 months ago a category system is provided to let you sort  your posts and generate a menu system for navigation.</p>
<p>You can assign posts to a category and you can also assign posts to Tags. When a visitor clicks on your sidebar posts menu they will be shown posts from that category. The code to display the categories is in your archive.php file. When a visitor reads a specific page on your Iguana you can display related tags at the top or bottom of your page that link to additional posts about your Iguana.</p>
<p>Setting up your WordPress Loop by using query_posts will allow you to modify the list of posts that are returned and either include or exclude posts based on a variety of criteria.</p>
<h2>Using query Posts</h2>
<p>To setup what data is retrieved in your loop you can place a <tt>query_posts</tt> before the loop.</p>
<p><strong>General format is like this</strong></p>
<pre class="brush: php; title: ; notranslate">&lt;?php
&lt;strong&gt;query_posts('your value here');&lt;/strong&gt;
while(have_posts()) { the_post();
&lt;!-- loop --&gt;
}
?&gt;

/1

&lt;hr /&gt;

To &lt;strong&gt;retrieve&lt;/strong&gt; just a single page &lt;strong&gt;by the ID&lt;/strong&gt; of 5
1 &lt;? query_posts('page_id=5'); ?&gt;</pre>
<p>To <strong>retrieve</strong> just a single page <strong>by name</strong></p>
<pre class="brush: php; title: ; notranslate"> &lt;? query_posts('name=about'); ?&gt;</pre>
<h3>Include or Exclude Categories</h3>
<p>To <strong>retrieve</strong> posts only from <strong>a single category</strong> 7</p>
<pre class="brush: php; title: ; notranslate"> &lt;?query_posts('cat=7'): ?&gt;</pre>
<p>To <strong>retrieve</strong> posts from <strong>a list of categories</strong></p>
<pre class="brush: php; title: ; notranslate"> &lt;? query_posts(cat=3,5,8); ?&gt;</pre>
<p>To <strong>exclude</strong> posts from <strong>Single category</strong> 7</p>
<pre class="brush: php; title: ; notranslate"> &lt;? query_posts('cat=-7'); ?&gt;</pre>
<p>To <strong>exclude a list of Categories</strong></p>
<pre class="brush: php; title: ; notranslate"> &lt;?query_posts('cat=-7,-8,-9'); ?&gt;</pre>
<h3>Order the Posts</h3>
<p>To retrieve posts in <strong>Ascending Order</strong></p>
<pre class="brush: php; title: ; notranslate"> &lt;? query_posts('cat=-7&amp;&lt;strong&gt;order=ASC&lt;/strong&gt;'); ?&gt;</pre>
<p>To retrieve posts in <strong>Descending</strong> <strong>Order</strong></p>
<pre class="brush: php; title: ; notranslate"> &lt;? query_posts('cat=-7&amp;&lt;strong&gt;order=DESC&lt;/strong&gt;'); ?&gt;</pre>
<p><strong>also use</strong></p>
<p>orderby=author<br />
orderby=date<br />
orderby=category<br />
orderby=title<br />
orderby=modified<br />
orderby=menu_order<br />
orderby=parent<br />
orderby=ID<br />
orderby=rand<br />
orderby=meta_value /This is an optional field set in the post</p>
<h3>The Number of posts to get</h3>
<p>To <strong>set the number of posts</strong> to be displayed per page</p>
<pre class="brush: php; title: ; notranslate"> &lt;? query_posts('cat=-7&amp;&lt;strong&gt;posts_per_page=6&lt;/strong&gt;'); ?&gt;</pre>
<h3>Use Meta or Custom Fields</h3>
<p>Custom fields are inserted by you when you write the post and can be retrieved as Meta Data within the loop or in this case can be used for sorting your posts.</p>
<p>meta_key= The Name of the custom field<br />
meta_value= The Value of the custom field<br />
meta_compare= values of &#8216;!=&#8217;, &#8216;&gt;&#8217;, &#8216;&gt;=&#8217;, &#8216;&lt;&#8217;, or &#8216;&lt;=&#8217;</p>
<p>To retrieve all the posts that have <strong>any</strong> color set (including all colors)<br />
query_posts(&#8216;meta_key=color&#8217;);</p>
<p>To retrieve <strong>only</strong> the posts that have the <strong>color</strong> set to <strong>blue</strong><br />
query_posts(&#8216;meta_<strong>key</strong>=<strong>color</strong>&amp;meta_<strong>value</strong>=<strong>blue&#8217;</strong>);</p>
<p>To retrieve posts where the custom field <strong>price</strong> is lower or equal to <strong>100</strong><br />
query_posts(&#8216;meta_key=<strong>price</strong>&amp;meta_compare=&lt;=&amp;meta_value=<strong>100</strong>&#8216;);</p>
<h3>To retrieve posts based on Tags</h3>
<p>To get posts with<strong> a single tag</strong><br />
query_posts(&#8216;tag=iguana&#8217;);</p>
<p>To get posts from <strong>either</strong> of these <strong>tag</strong>s<br />
query_posts(&#8216;tag=iguana,chicken&#8217;);</p>
<p>To get posts that belong <strong>only</strong> to <strong>ALL</strong> tags<br />
query_posts(&#8216;tag=mypets+chicken+iguana&#8217;);</p>
<h2><strong>Note</strong></h2>
<p>There are a number of other ways to use the query post call to your database to setup how your posts.</p>
<p>A great way to use this call is to display your front page as a home page or setup special category theme pages to customize how special categories display for your visitor.</p>
<p>For more information visit the WordPress codex:</p>
<p><a href="http://codex.wordpress.org/Template_Tags/query_posts" target="_blank">http://codex.wordpress.org/Template_Tags/query_posts</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.npsites.com/134/howto-using-query-posts-to-display-posts-in-wordpress.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HowTo &#8211; WordPress Conditional Tags To Control When Things Happen</title>
		<link>http://www.npsites.com/159/howto-wordpress-conditional-tags-to-control-when-things-happen.html</link>
		<comments>http://www.npsites.com/159/howto-wordpress-conditional-tags-to-control-when-things-happen.html#comments</comments>
		<pubDate>Wed, 11 Mar 2009 06:07:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Wordpress Tips]]></category>

		<guid isPermaLink="false">http://www.npsites.com/?p=159</guid>
		<description><![CDATA[WordPress has a number of ways to format your themes including all of the different template files you can use to limit what happens when your visitors view a Page, Post, Category Listing, Archive Listing, or your Home page. In addition to the Theme Template files you can also use Conditional Tags to instruct WordPress [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-86" title="wordpress_logo" src="http://www.npsites.com/npsblog/wp-content/uploads/2009/01/wordpress_logo.jpg" alt="wordpress_logo" width="150" height="39" />WordPress has a number of ways to format your themes including all of the different template files you can use to limit what happens when your visitors view a Page, Post, Category Listing, Archive Listing, or your Home page.</p>
<p>In addition to the Theme Template files you can also use Conditional Tags to instruct WordPress to do things when people are visiting certain Pages, Posts or when they are reading a post inside a certain Category or if they are viewing the Home Page.</p>
<p>When is this useful?</p>
<p>Well the real uses are limitless but in reality one of the most useful things about conditional tags is formatting your menus and sidebars when your visitors are reading specific content.</p>
<p>For instance if you had a conditional tag set for your Contact Page then you could remove advertising just for that page by loading or unloading sidebars limiting functions.</p>
<p>You can also setup added content that will only be displayed if you are an Administrator.</p>
<p>For example if you wanted something to show on all of your single post pages you could place this in your sidebar.php</p>
<pre><strong><span style="color: #0000ff;">if (is_single())
{
     echo 'This is a single post menu';
}</span></strong></pre>
<p>Obviously you would put a whole menu or banner or something useful in your code.</p>
<p>However if you only wanted to change something when a specific post is being shown you might use.</p>
<p><strong><span style="color: #0000ff;">is_single(&#8217;35&#8242;)</span></strong></p>
<p>Where 35 is the ID of the post or</p>
<p><strong><span style="color: #0000ff;">is_single(&#8216;Map Post&#8217;)</span></strong><tt><br />
Where</tt> the title of the page is Map Post</p>
<p><strong><span style="color: #0000ff;">is_single(&#8216;map-post&#8217;)</span></strong><br />
Where the slug of the page is map-post</p>
<p>or maybe you have a category full of posts with maps.</p>
<p><strong><span style="color: #0000ff;">in_category(&#8217;5&#8242;</span></strong><tt>)</tt><br />
would work when ever a post is shown and it is in category 5</p>
<p>.</p>
<p>There are a heck of a lot of Conditional variables that you can use to limit or display information. And you should try to be as creative as you can when using conditional tags.</p>
<p>For more information visit the WordPress Codex page.</p>
<p>http://codex.wordpress.org/Conditional_Tags</p>
<p>.</p>
<p>Here is a list of Conditions that you can use in your themes to restrict or display content based on if the value is true or not.</p>
<p>comments_open<br />
has_tag<br />
in_category<br />
is_404<br />
is_admin<br />
is_archive<br />
is_attachment<br />
is_author<br />
is_category<br />
is_comments_popup<br />
is_date<br />
is_day<br />
is_feed<br />
is_front_page<br />
is_home<br />
is_month<br />
is_page<br />
is_page_template<br />
is_paged<br />
is_preview<br />
is_search<br />
is_single<br />
is_singular<br />
is_sticky<br />
is_tag<br />
is_time<br />
is_trackback<br />
is_year<br />
pings_open</p>
]]></content:encoded>
			<wfw:commentRss>http://www.npsites.com/159/howto-wordpress-conditional-tags-to-control-when-things-happen.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
