WordPress.org

Ready to get started?Download WordPress

Forums

Random Text
Display all? (8 posts)

  1. jeeni
    Member
    Posted 2 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!

    http://wordpress.org/extend/plugins/randomtext/

  2. MariGarza
    Member
    Posted 2 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"]

    Code:
    http://pastebin.com/Xxc1ura6

  3. jeeni
    Member
    Posted 2 years ago #

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

  4. creativeafrica
    Member
    Posted 2 years ago #

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

  5. MariGarza
    Member
    Posted 2 years ago #

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

  6. Kizzie86
    Member
    Posted 2 years ago #

    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

  7. MariGarza
    Member
    Posted 2 years ago #

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

  8. jeeni
    Member
    Posted 1 year 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

About this Topic

Tags