Skip to content

Instantly share code, notes, and snippets.

@versluis
Last active Sep 3, 2020
Embed
What would you like to do?
Creating basic Shortcodes in WordPress
<?php
// 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