Created
October 23, 2016 07:52
-
-
Save mattwilding/68838f5c8a40b6be7b9795889c470431 to your computer and use it in GitHub Desktop.
This file contains 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 my_shortcode_function() { | |
return '<p>This is generated by my shortcode</p>'; | |
} | |
add_shortcode( 'my_shortcode', 'my_shortcode_function' ); | |
// enter the shortcode [my_shortcode] to your page/post content and the page/post will display "This is generated by my content" in <p> tags | |
function my_content_shortcode_function( $atts, $content = null ) { | |
return '<span class="caption">' . $content . '</span>'; | |
} | |
add_shortcode( 'my_content_shortcode', 'my_content_shortcode_function' ); | |
//enter the shortcode [my_content_shortcode]This is the text I want to format[/my_content_shortcode] into your page/post and the rendered page/post will show | |
// "This is the text I want to format" wrapped in <span> tags. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment