Posted By

adambundy on 10/27/10


Tagged

wordpress


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

adambundy
baczoni
hkamci


Wordpress Self-Closing Shortcode


 / Published in: PHP
 

  1. // FOR THE FUNCTIONS.PHP FILE >>
  2.  
  3. function do_my_shortcode( $atts, $content = null ) {
  4. return '<div class="something">' . $content . '</div>';
  5. }
  6. add_shortcode('shortcode_label', 'do_my_shortcode');
  7.  
  8.  
  9.  
  10. // TO USE THE SHORTCODE >>
  11.  
  12. [shortcode_label]My Caption[/shortcode_label]

Report this snippet  

You need to login to post a comment.