Allows the user to create a list of quotes, and then pull either a random or specific quote from that list
|Author:||jfcby (profile at wordpress.org)|
|WordPress version required:||4.0|
|WordPress version tested:||4.9.5|
|Added to WordPress repository:||04-12-2008|
|Total downloads:||1 090|
Click to start download
- Upload the plugin files to the
/wp-content/plugins/randomquotrdirectory, or install the plugin through the WordPress plugins screen directly.
- Activate the plugin through the ‘Plugins’ screen in WordPress
- Use the Settings->RandomQuotr screen add quotes in the textarea on the left-hand side. Quotes are split by carriage returns (line breaks)
- Use the following hooks to display the quotes:
Get a random quote
rdqr_random_quote(); – this will display the text automatically.
$quote = rdqr_get_random_quote(); – this stores the text within a variable.
Getting a specific quote
rdqr_target_quote(3); – this will display the third quote in the list.
$quote = rdqr_get_target_quote(); – this stores the text within a variable.
I’m using rdqr_target_quote(0) and nothing’s coming up! I know I have added quotes
The list starts at 1 not 0.
rdqr_target_quote and rdqr_get_target_quote are not doing anything!
Make sure that you are passing in a valid value. If you are passing in an invalid number (below 1, above the number of quotes), a non-number (“forty”), or there are no quotes to get, all of the functions will return null.
Can a shortcode be used to display a random quote?
Yes, use [rdqr_randomquote] in a page or post.
Can a shortcode be used to display a specific quote?
Yes, use [rdqr_targetquote singlequote=”3″] to display the third quote. Change the number 3 to the quote that you want displayed.
Can shortcodes be used in theme files?
Yes, to display a random quote place in your theme template. Display a specific quote by placing in your theme template. Change the number 3 to the quote that you want displayed.
Can shortcodes be used in widgets?
Yes, the shortcodes can be used in widgets.
- added shortcodes
- made within the functions.php file of the theme
- created plugin, cleaned things up