[teaser]In some themes you can choose random orders for a few things. In ours, we give you shortcodes to randomize anything! From simple random number generators, to the ability to randomly choose a bit of text, to randomizing the order of an entire gallery! Remember to refresh the page and watch the changes.[/teaser] [line] [h4]Random Number[/h4] This simplest randomizing shortcode is the ability to simply output random numbers. Choose a minimum, choose a maximum and get your result. For example, here will show a random number from 1 to 20: [random_number min=”1″ max=”20″] [code_table] [code_line][random_number min=”1″ max=”20″][/code_line] [/code_table] [line] [h4]Random Values[/h4] After random numbers, the next important thing is random values. You create a list of values and choose to output one (or any number or them) in a random order. For example the following is a random selection from a list of shapes: [random_value]square, circle, triangle, rectangle, oval, trapezoid[/random_value] [code_table] [code_line][random_value]square, circle, triangle, rectangle, oval, trapezoid[/random_value][/code_line] [/code_table] [line] [h4]Random List[/h4] Just outputting random values everywhere isn’t enough. Sometimes you need to randomize the orders of things, and then use the values in random order in multiple places. For that we have the random lists. In this examples we’ll put a list of colors in random order:
[random_list]blue, green, red, orange, yellow, purple[/random_list] Color One: [random_list_value num=”1″] Color Two: [random_list_value num=”2″] Color Three: [random_list_value num=”3″] Color Four: [random_list_value num=”4″] Color Five: [random_list_value num=”5″] Color Five: [random_list_value num=”6″] [code_table] [code_line][random_list]blue, green, red, orange, yellow, purple[/random_list][/code_line] [code_line]Color One: [random_list_value num=”1″][/code_line] [code_line]Color Two: [random_list_value num=”2″][/code_line] [code_line]Color Three: [random_list_value num=”3″][/code_line] [code_line]Color Four: [random_list_value num=”4″][/code_line] [code_line]Color Five: [random_list_value num=”5″][/code_line] [code_line]Color Five: [random_list_value num=”6″][/code_line] [/code_table] [line] [h4]Random Content[/h4] Last but not least is the most powerful of them all, random sets of content (which includes containing other shortcode content). This allows you to not only choose a random bit of content to show, but also to randomize the order of sets of content as well. For example, here’s an example of an accordion with it’s values in random order:
[accordion] [random_content_set amount=”4″] [random_content][accordion_item title=”Orange”]Lorem ipsum sit amet dolor. Lorem ipsum sit amet dolor. Lorem ipsum sit amet dolor. Lorem ipsum sit amet dolor.[/accordion_item][/random_content] [random_content][accordion_item title=”Blue”]Lorem ipsum sit amet dolor. Lorem ipsum sit amet dolor. Lorem ipsum sit amet dolor. Lorem ipsum sit amet dolor.[/accordion_item][/random_content] [random_content][accordion_item title=”Green”]Lorem ipsum sit amet dolor. Lorem ipsum sit amet dolor. Lorem ipsum sit amet dolor. Lorem ipsum sit amet dolor.[/accordion_item][/random_content] [random_content][accordion_item title=”Purple”]Lorem ipsum sit amet dolor. Lorem ipsum sit amet dolor. Lorem ipsum sit amet dolor. Lorem ipsum sit amet dolor.[/accordion_item][/random_content] [/random_content_set] [/accordion] [code_table] [code_line][accordion][/code_line] [code_line][random_content_set amount=”4″][/code_line] [code_line][random_content][accordion_item title=”Orange”]Lorem ipsum…[/accordion_item][/random_content][/code_line] [code_line][random_content][accordion_item title=”Blue”]Lorem ipsum…[/accordion_item][/random_content][/code_line] [code_line][random_content][accordion_item title=”Green”]Lorem ipsum…[/accordion_item][/random_content][/code_line] [code_line][random_content][accordion_item title=”Purple”]Lorem ipsum…[/accordion_item][/random_content][/code_line] [code_line][/random_content_set][/code_line] [code_line][/accordion][/code_line] [/code_table]

Leave a Reply

Your email address will not be published. Required fields are marked *

Post comment