Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Random Daily Article.
How do I display an article at random that changes on a daily basis?
Know it’s a simple one, but…
Offline
Re: Random Daily Article.
Not that easy with core, no. I can’t think of an easy way to do this with TXP. But if you know some basic PHP, you could do this with a plugin, and it wouldn’t be that hard.
Offline
#3 2006-02-18 03:38:51
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Random Daily Article.
<txp:article_custom sortby="rand()" limit="1" />
can give you random, but yeah it’d change on every page load.
Offline
Re: Random Daily Article.
Welcome back Mary…
Yeah, sortby="rand()"
was one of the first tricks I learned. But the daily duration is the bit thta eludes me.
I’ve been looking at the code in mdp_rotating_image, an oldie that produces a randomly rotating image that rotates every hour/day/week/month/year but it seems to load an image into a cache directory or something, which it replaces based on a PHP routine.
I’ll post if I find anything further.
Offline
Pages: 1