lion_neel

Add Custom Shortcode in Wordpress Theme

Jun 15th, 2013
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function box($atts, $content = null) {
  2.     return('<div class="boxed_style">'.$content.'</div>');
  3. }
  4. add_shortcode("box", "box");
  5.  
  6. function youtube($atts, $content = null) {
  7.     return ('<iframe width="560" height="315" src="http://www.youtube.com/embed/'.$content.'" frameborder="0" allowfullscreen></iframe>');
  8. }
  9. add_shortcode("youtube", "youtube");
  10.  
  11. function vimeo($atts, $content = null) {
  12.     return ('<iframe src="http://player.vimeo.com/video/'.$content.'" width="400" height="300" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>');
  13. }
  14. add_shortcode("vimeo", "vimeo");
Add Comment
Please, Sign In to add comment