Last active
January 3, 2018 15:10
-
-
Save intelliweb/5383647 to your computer and use it in GitHub Desktop.
WP: add shortcode. Replace SHORTCODE_TAG with whatever text you want to use in the shortcode.
This file contains hidden or 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
<?php | |
// Shortcode: [SHORTCODE_TAG] | |
add_shortcode('SHORTCODE_TAG', 'intw_shortcode_SHORTCODE_TAG'); | |
function intw_shortcode_SHORTCODE_TAG($atts) { | |
extract( shortcode_atts( array( | |
'att1' => 'DEFAULT_VALUE', | |
'att2' => 'DEFAULT_VALUE', | |
), $atts ) ); | |
ob_start(); ?> | |
<!-- START SHORTCODE OUTPUT --> | |
<div class=""> | |
<a href="<?php echo $att1; ?>"><?php echo $att2; ?></a> | |
</div> | |
<!-- END SHORTCODE OUTPUT --> | |
<?php return ob_get_clean(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment