I wrote this for my own use. Hope it helps.
On randomtext.php add the following code on line 198 (Version: 0.2.9) below
add_shortcode('randomtext', 'randomtext_shortcode');
You can use shortcodes [alltext] or [alltext category=”funny”]
Code:
http://pastebin.com/Xxc1ura6
Thread Starter
jeeni
(@jeeni)
Oh wow – thank you! I will give it a try – thanks for sharing, MariGarza!
That worked amazing! Can you tell me how to still Randomize the results?
Much appreciated!
Order by RAND() instead of randomtext_id asc (line 11 in the codeblock sample)
$sql .= ' ORDER BY RAND()';
MariGarza
you seem to know what you are talking about – hopefully maybe you can help me?
I really like this widget and I have another one called slickrflickr which I have display as a slideshow with a 5 sec delay
is there anyway I can produce code to make the randomtext generate a new code without having to refresh?
Maybe using some preexisting code from slickrflickr?
any help you code provide would be greatly appreciated!!!
Kiz
You would need a widget written in javascript to accomplish a browser side action like this.
Thread Starter
jeeni
(@jeeni)
Wanted to peek my head in and say another “Thank you!” to you, MariGarza!
I put the code you shared in my functions.php page so I wouldn’t overwrite it if/when the plugin was updated and it works perfectly.
Thanks again so much for sharing your knowledge and this help!