Random Quotes Shortcode
Use [random_quote] shortcode to display random quotes from Quotable API.
by Rameez Joya · github.com/ram33z/random-quote-shortcode · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/ram33z/random-quote-shortcode/archive/refs/heads/master.zipRandom Quotes WordPress Plugin
This plugin enables the usage of [random_quote] shortcode, which will display random quote from Random Quotes API.
Installation
Once downloaded just unzip it and move the folder into the /wp-content/plugins folder within your WordPress install.
Usage
Put [random_quote]anywhere in Post content area or in custom_html block of wigets.
Attributes
Following attributes are supported to customize behaviour of [random_quote] shortcode:
- length : Provide numeric value to limit display of number of characters in Quote. If trimmed, elipses ... are added at the end.
- class : To replace css class in enclosing html element for Quote. By default blockquote class is added.
- api: If value
falseprovided then an API call will be omitted and random quote from local static Quotes list will be shown.
Example with attribute
[random_quote api='false' class='strong' length='20']
To display shortcode in header or footer areas add following in your theme's template:
<?php echo do_shortcode("[random_quote]"); ?>
Resources
- Quotable : Quotable is a free, open source quotations API.