Skip to content

Instantly share code, notes, and snippets.

@dannyockilson
Created May 17, 2013 14:33
Show Gist options
  • Save dannyockilson/5599429 to your computer and use it in GitHub Desktop.
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 }"]
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