Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Random post
Hello,
is there any way to make a link that opens a random post? Or will I need a plugin for this? I had a similar function in my WordPress powered diary where my visitors could hit the “I’m feeling lucky”-link and read a random entry.
Offline
#2 2006-01-10 14:47:21
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Random post
<txp:article_custom limit="1" sortby="rand()" listform="blah" />
Example listform:
<code>
<txp:permlink>Random article</txp:permlink>
</code>
I think that should work. You could also specify section and/or category in the article_custom tag.
Last edited by doggiez (2006-01-10 14:52:18)
Offline
#3 2006-01-10 16:41:06
- alexandra
- Member
- From: Cologne, Germany
- Registered: 2004-04-02
- Posts: 1,370
Re: Random post
@goggiez
Does sortby=rand() work? If so, we should add it to article_custom in Textbook.
Offline
#4 2006-01-10 17:13:08
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Random post
Yes, I’ve been using it for ages to show a random quote on my site. Still working in 4.0.3.
Edit: it’s there on the attributes page.
Last edited by doggiez (2006-01-10 17:15:24)
Offline
#5 2006-01-10 17:17:38
- alexandra
- Member
- From: Cologne, Germany
- Registered: 2004-04-02
- Posts: 1,370
Re: Random post
ahh i see.. i was checking txp:article_custom whre it is missing
Offline
#6 2006-01-10 22:08:25
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Offline
Pages: 1