Hi,
Unfortunately, this isn’t possible with the plug-in. By default, the shortcode outputs a random number each time it’s called. This would require updating the plug-in to set an identifier so a number can be reused again. I like the idea, but I don’t currently have the time to update it.
One idea I can think of off the top of my head would be the wrap the shortcode in a span tag, then use jQuery to grab the number that is generated, and paste it between a different span tag. I did a quick test and the below worked for me.
HTML
Here is my first random number: <span class=”n01″>[arandomnumber min=1 max=10000]</span>
Here is my second random number: <span class=”n02″>[arandomnumber min=1 max=100]</span>
Here is the first number again: <span class=”n01a”></span>
Here is the second number again: <span class=”n02a”></span>
JS
jQuery(document).ready(function() {
jQuery( ".n01" ).clone().appendTo( ".n01a" );
jQuery( ".n02" ).clone().appendTo( ".n02a" );
});
Class names can be changed to anything else, and you can add as many as you like. The JS code needs to be placed in a custom.js file or wrapped in a script tag and placed in a field for custom code, if your theme has one.
This will always take the value of whatever is within the n01 span tag and append it to the n01a span tag. Each time the page reloads the numbers will change, but n01 will always match n01a, etc.
I hope this is helpful!
-
This reply was modified 5 years, 10 months ago by
macardam.
-
This reply was modified 5 years, 10 months ago by
macardam. Reason: formatting