Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Show new articles different than others?
Is there in txp or as a plugin a way to display, lets say, all articles that are less than 2 days old, in a different style than the others?
I mean something like this:
<txp:if_older_than days=“2”><div class=“new”></txp:if_older_than>
?
Last edited by gemal (2007-08-23 10:42:30)
Offline
Re: Show new articles different than others?
You can put some peace of php code in your article form to do that
for examlpe:
<txp:php>
$gap = 2*24*60*60;
$t = strtotime(“now”);
$a = posted (array ());
$diff = $t – $a
if ($diff < $gap) {
echo ‘<div class=“new”>’
}
</txp:php>
I haven’t tested the code, but i think you have the main idea of what must you do.
Offline
Re: Show new articles different than others?
One of these plugins perhaps?
Offline
#4 2007-08-23 16:13:40
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Show new articles different than others?
Offline