Last active
April 19, 2018 02:14
-
-
Save jerrickhakim/d81eae7ab53bbc1b4515e333000c1c39 to your computer and use it in GitHub Desktop.
HTML To Shortcode WordPress
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 register_my_shortcode() { | |
ob_start(); ?> | |
<div class="my-shortcode"> | |
<h1>Hi, I am the shortcode.</h1><hr /> | |
<p>This is a screenshot of how I was created!</p> | |
<img src="https://d153h1xtzgec02.cloudfront.net/shortcode-function-blog-post.png" alt="Function Screen Shot"> | |
<p>I was created by pasting [shortcode_name] on this post!</p> | |
</div> | |
<?php | |
return ob_get_clean(); | |
} | |
add_shortcode ('shortcode_name', 'register_my_shortcode' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment