Skip to content

Instantly share code, notes, and snippets.

Last active Sep 3, 2020
What would you like to do?
Creating basic Shortcodes in WordPress
// create your shortcode function
function guru_my_shortcode() {
// do something here
// return text you want to display
return $output;
// register all shortcodes
function guru_shortcodes() {
add_shortcode( 'your-handle', 'guru_my_shortcode' );
add_action( 'init', 'guru_shortcodes' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment