<?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; PHP</title>
	<atom:link href="http://savvyadmin.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://savvyadmin.com</link>
	<description>For savvy admins everywhere...</description>
	<lastBuildDate>Sun, 20 Jun 2010 21:53:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</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>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fsavvyadmin.com%2Fflag-wordpress-posts-as-outdated%2F&amp;partner=sociable" title="Print"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsavvyadmin.com%2Fflag-wordpress-posts-as-outdated%2F&amp;t=Flag%20Wordpress%20Posts%20as%20Outdated" title="Facebook"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://twitter.com/home?status=Flag%20Wordpress%20Posts%20as%20Outdated%20-%20http%3A%2F%2Fsavvyadmin.com%2Fflag-wordpress-posts-as-outdated%2F" title="Twitter"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fsavvyadmin.com%2Fflag-wordpress-posts-as-outdated%2F&amp;title=Flag%20Wordpress%20Posts%20as%20Outdated&amp;notes=The%20following%20outlines%20the%20process%20of%20dynamically%20adding%20a%20blockquote%20message%20at%20the%20top%20of%20any%20post%20you%20have%20flagged%20as%20being%20%22outdated%22.%C2%A0%20Over%20time%2C%20your%20posts%20can%20become%20outdated%20or%20even%20completely%20inaccurate%2C%20especially%20if%20you%27re%20running%20a%20tech%20" title="del.icio.us"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://savvyadmin.com/feed/" title="RSS"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fflag-wordpress-posts-as-outdated%2F&amp;title=Flag%20Wordpress%20Posts%20as%20Outdated&amp;bodytext=The%20following%20outlines%20the%20process%20of%20dynamically%20adding%20a%20blockquote%20message%20at%20the%20top%20of%20any%20post%20you%20have%20flagged%20as%20being%20%22outdated%22.%C2%A0%20Over%20time%2C%20your%20posts%20can%20become%20outdated%20or%20even%20completely%20inaccurate%2C%20especially%20if%20you%27re%20running%20a%20tech%20" title="Digg"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="mailto:?subject=Flag%20Wordpress%20Posts%20as%20Outdated&amp;body=http%3A%2F%2Fsavvyadmin.com%2Fflag-wordpress-posts-as-outdated%2F" title="email"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fflag-wordpress-posts-as-outdated%2F&amp;title=Flag%20Wordpress%20Posts%20as%20Outdated&amp;source=SavvyAdmin.com+For+savvy+admins+everywhere...&amp;summary=The%20following%20outlines%20the%20process%20of%20dynamically%20adding%20a%20blockquote%20message%20at%20the%20top%20of%20any%20post%20you%20have%20flagged%20as%20being%20%22outdated%22.%C2%A0%20Over%20time%2C%20your%20posts%20can%20become%20outdated%20or%20even%20completely%20inaccurate%2C%20especially%20if%20you%27re%20running%20a%20tech%20" title="LinkedIn"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Fsavvyadmin.com%2Fflag-wordpress-posts-as-outdated%2F" title="Identi.ca"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/identica.png" title="Identi.ca" alt="Identi.ca" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsavvyadmin.com%2Fflag-wordpress-posts-as-outdated%2F&amp;title=Flag%20Wordpress%20Posts%20as%20Outdated&amp;annotation=The%20following%20outlines%20the%20process%20of%20dynamically%20adding%20a%20blockquote%20message%20at%20the%20top%20of%20any%20post%20you%20have%20flagged%20as%20being%20%22outdated%22.%C2%A0%20Over%20time%2C%20your%20posts%20can%20become%20outdated%20or%20even%20completely%20inaccurate%2C%20especially%20if%20you%27re%20running%20a%20tech%20" title="Google Bookmarks"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsavvyadmin.com%2Fflag-wordpress-posts-as-outdated%2F&amp;title=Flag%20Wordpress%20Posts%20as%20Outdated" title="StumbleUpon"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>


<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>
