Code: Textpattern Dynamic DateFeb 02 2011, 19:01 PM
Textpattern does not seem to support dynamic dates intrinsically, so here is a workaround I use. In this case, it will show the full date if it’s not in the current year, otherwise skip the year part. This approach can certainly be used for more advanced styling as well.
<span class="posted">
<txp:php>
if(posted(array('format'=>'%Y'))<date("Y"))
{
echo posted(array('format'=>'%b %d %Y, %R %p'));
}else
{
echo posted();
}
</txp:php>
</span>
<txp:php>
if(posted(array('format'=>'%Y'))<date("Y"))
{
echo posted(array('format'=>'%b %d %Y, %R %p'));
}else
{
echo posted();
}
</txp:php>
</span>
