Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Txp:posted
Hi I’m trying to add the suffix ST, RD, ND to my days using the Txp:posted tag.
I have come across this code: <?php
function &daySufix ($dayNumber = false){
(string) $dayNumber = (!$dayNumber) ? strftime (“%#d”) : $dayNumber;
$sufixes = Array (“1” => “st”, “2” => “nd”, “3” => “rd”);
return (isset ($sufixes[$dayNumber])) ? $sufixes[$dayNumber] : “th”;
}
?>
Use it as follow:
<?php
echo strftime (“%A, %b. %#d” . daySufix() . “ %Y”);
?>
How would I use this with Txp:posted? Or would you have to custom code your own PHP to get the suffix? I tried the above, but it complained that the daySuffix was already declared in taghandlers.php
Found this: http://forum.textpattern.com/viewtopic.php?id=29744
Last edited by driz (2009-02-25 20:18:20)
~ Cameron
Offline
Pages: 1