Skip to content

Instantly share code, notes, and snippets.

@jerewall
Created March 13, 2015 18:35
Show Gist options
  • Save jerewall/42b0334c80a2f58d84fb to your computer and use it in GitHub Desktop.
Save jerewall/42b0334c80a2f58d84fb to your computer and use it in GitHub Desktop.
Create a custom shortcode in wordpress using functions for any code
// reviews widget provided by customer
function shortcodenamehere_function() {
$text = <<<TEXT
(Insert any code here)
TEXT;
return $text;
}
add_shortcode('shortcodenamehere', 'shortcodenamehere_function');
// end shortcode creator
// put this on the page or post:
[shortcodenamehere]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment