<?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>SavvyAdmin.com &#187; Wordpress</title>
	<atom:link href="http://savvyadmin.com/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://savvyadmin.com</link>
	<description>For savvy admins everywhere...</description>
	<lastBuildDate>Fri, 21 Jan 2011 17:53:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Flag WordPress Posts as Outdated</title>
		<link>http://savvyadmin.com/flag-wordpress-posts-as-outdated/</link>
		<comments>http://savvyadmin.com/flag-wordpress-posts-as-outdated/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 11:00:39 +0000</pubDate>
		<dc:creator>gmendoza</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[Blogging]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.savvyadmin.com/?p=520</guid>
		<description><![CDATA[The following outlines the process of dynamically adding a blockquote message at the top of any post you have flagged as being &#8220;outdated&#8221;.  Over time, your posts can become outdated or even completely inaccurate, especially if you&#8217;re running a tech blog, since software constantly changes. This will help warn readers that there may be issues [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>The following outlines the process of dynamically adding a blockquote message at the top of any post you have flagged as being &#8220;outdated&#8221;.  Over time, your posts can become outdated or even completely inaccurate, especially if you&#8217;re running a tech blog, since software constantly changes.  This will help warn readers that there may be issues with the post in it&#8217;s current condition.</p>
<p>I did some digging around and couldn&#8217;t find an official plugin that took care of this.   I did however stumble across a <a href="http://solutions.treypiepmeier.com/2008/06/14/using-wordpress-custom-fields/" target="_blank">blog post</a> by <a title="Trey Piepmeier" href="http://treypiepmeier.com" target="_blank">Trey Piepmeier</a> that helped me understand a fairly straight forward method of doing it yourself.  I typically don&#8217;t like to rehash work someone has already discussed, but I figured it would help to give a little more detail for those interested.  Depending on your PHP and WordPress theme modification skills, you can change this however you like.</p>
<p>PLEASE MAKE A BACKUP OF YOUR THEME BEFORE CHANGING ANYTHING.</p>
<p>You can place the following PHP &#8220;if&#8221; condition just BELOW the code referencing your post title and ABOVE the code referencing your post content.  The get_post_meta() function assigns the $status variable with the value of a custom field you will later define as &#8220;outdated&#8221;.  If it matches, then a blockquote message will be printed, otherwise it will be skipped and the post will continue as normal.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$status</span> <span style="color: #339933;">=</span> get_post_meta<span style="color: #009900;">&#40;</span>get_the_ID<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'status'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$status</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'outdated'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;blockquote&gt;
    &lt;p align=&quot;center&quot;&gt;&lt;font color=&quot;red&quot;&gt;&lt;strong&gt;
    WARNING! THIS POST HAS BEEN MARKED AS OUTDATED!
    &lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
    &lt;p align=&quot;center&quot;&gt;&lt;strong&gt;
    Enter some useful message here about the article being old.
    &lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Depending on your theme, this can typically be done in your themes <code>index.php</code> and <code>single.php</code> files, but you should also update any other you use to publish posts from.</p>
<p>Then, all you need to do is edit any of your outdated posts and add a custom field with the name of &#8220;status&#8221; and a value of &#8220;outdated&#8221; without any quotes and your work is complete.</p>
<p><img class="aligncenter size-full wp-image-524" title="Outdated Custom Field" src="http://www.savvyadmin.com/wp-content/uploads/2009/12/Outdated-Custom-Field.png" alt="Outdated Custom Field" width="490" height="137" /></p>
<p>An example of what this might look like on your blog is shown below.</p>
<p style="text-align: center;"><a href="http://www.savvyadmin.com/wp-content/uploads/2009/12/Outdated-Post-Example.png" target="_blank"><img class="aligncenter size-full wp-image-525" style="border: 1px solid black;" title="Outdated Post Example" src="http://www.savvyadmin.com/wp-content/uploads/2009/12/Outdated-Post-Example.png" alt="Outdated Post Example" width="404" height="215" /></a></p>
<p>Please feel free to leave comments, suggestions or concerns.  A great deal of help on figuring this out was also provided in the #Wordpress IRC channel on irc.freenode.net.  If you find yourself in a pickle, there&#8217;s always someone there willing to help you out.</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://savvyadmin.com/flag-wordpress-posts-as-outdated/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

