• ILAsoft.net Blog

    Textpattern Dynamic Date

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.
[syntax_prettify linenums=”linenums”]if(posted(array(‘format’=>’%Y’))<date(“Y”))
{
echo posted(array(‘format’=>’%b %d %Y, %R %p’));
}else
{
echo posted();
}[/syntax_prettify]

 

Contact Me

Information you submit through the form below will only be used in answering the email.