<?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 First Aid &#187; modified_post</title>
	<atom:link href="http://wpfirstaid.com/tag/modified_post/feed/" rel="self" type="application/rss+xml" />
	<link>http://wpfirstaid.com</link>
	<description>It&#039;s WordPress ... anything is possible!</description>
	<lastBuildDate>Thu, 26 Apr 2012 14:24:14 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-beta4-20725</generator>
		<item>
		<title>Modified Post Function</title>
		<link>http://wpfirstaid.com/2010/03/modified-post-function/</link>
		<comments>http://wpfirstaid.com/2010/03/modified-post-function/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 19:14:33 +0000</pubDate>
		<dc:creator>The Doctor</dc:creator>
				<category><![CDATA[Functions]]></category>
		<category><![CDATA[get_the_date]]></category>
		<category><![CDATA[modified_post]]></category>
		<category><![CDATA[version_compare]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://wpfirstaid.com/?p=494</guid>
		<description><![CDATA[A simple function to show who modified a post last and when in WordPress versions 3.0 and greater.]]></description>
			<content:encoded><![CDATA[<p>Here is a simple bit of code you can drop into your <strong>functions.php</strong> file then use in any of your templates where you want to display a short statement telling when a post was last modified.</p>
<pre class="brush: php; title: ; notranslate">
// Modified Post - requires WordPress version 3.0 or greater
function modified_post(){
  global $wp_version;
  if (version_compare($wp_version, &quot;2.999&quot;, &quot;&gt;&quot;)) {
    /* If the post date and the last modified date are different display modified post details */
    if ( get_the_date() &lt;&gt; get_the_modified_date() ) {
      echo '&lt;div class=&quot;modified-post&quot;&gt;'; /* CSS wrapper for modified post details */
      echo 'Last modified by ' . get_the_modified_author() . ' on ' . get_the_modified_date();
      echo '&lt;/div&gt;&lt;!-- .modified-post --&gt;';
    }
  }
}
</pre>
<p>Of course, you may have noticed the check for <a href="http://wordpress.org/download/nightly/">WordPress version 3.0 or greater</a>. This is required as the function <em><a href="http://phpdoc.wordpress.org/trunk/WordPress/Template/_wp-includes---general-template.php.html#functionget_the_date">get_the_date()</a></em> on line 6 is currently only found in versions of WordPress starting at 3.0</p>
<p>Once the above code has been added to your <strong>functions.php</strong> file <em>and</em> you are using a version of <em>WordPress greater than or equal to 3.0</em> then all you need to do is drop the following line of code inside <a href="http://codex.wordpress.org/The_Loop">the loop</a> of the template file you want to display the modified post details on.</p>
<pre class="brush: plain; light: true; title: ; notranslate">&lt;?php modified_post(); ?&gt;</pre>
<p>Also included is a CSS class element for easy styling. The code can be easily edited to add more elements, too.</p>
<p>Now, what good is this little bit of code? Have a look around and see it in action.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpfirstaid.com/2010/03/modified-post-function/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

