Random Text
Display all? (8 posts)

  1. jeeni
    Posted 4 years ago #

    Hello there - love your plugin - thank you so much for your hard work!

    I love using the widget to bring up one random saying in the sidebar, but would love to be able to publish a whole category to a page. Is there (or will there be) support for pulling all sayings from a category to a page using shortcodes?

    I'm using them as testimonials, and it would be nice to be able list them all on a page.

    Thank you!


  2. MariGarza
    Posted 4 years ago #

    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"]


  3. jeeni
    Posted 4 years ago #

    Oh wow - thank you! I will give it a try - thanks for sharing, MariGarza!

  4. creativeafrica
    Posted 4 years ago #

    That worked amazing! Can you tell me how to still Randomize the results?
    Much appreciated!

  5. MariGarza
    Posted 4 years ago #

    Order by RAND() instead of randomtext_id asc (line 11 in the codeblock sample)
    $sql .= ' ORDER BY RAND()';

  6. Kizzie86
    Posted 4 years ago #


    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!!!


  7. MariGarza
    Posted 4 years ago #

    You would need a widget written in javascript to accomplish a browser side action like this.

  8. jeeni
    Posted 3 years ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Random Text
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic