Created
May 17, 2013 14:33
-
-
Save dannyockilson/5599429 to your computer and use it in GitHub Desktop.
Wordpress Function to add [lipsum] | [lipsum amount="int"] | [lipsum type="{ paras | words | bytes | lists }"]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function lipsum_shortcode($atts) { | |
extract(shortcode_atts(array('amount' => 1, 'type' => 'paras'), $atts)); | |
$lipsum = simplexml_load_file("http://www.lipsum.com/feed/xml?amount=$amount&what=$type")->lipsum; | |
return $lipsum; | |
} | |
add_shortcode('lipsum', 'lipsum_shortcode'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment