SHARE
TWEET

Untitled

YellowShark Feb 13th, 2013 29 Never
  1. <?php
  2.  
  3. // [h1]
  4. function h1($atts, $content = null) {
  5.         $defaults = array('align' => '', 'color' => '');
  6.         extract( shortcode_atts( $defaults, $atts ) );
  7.         $tag_class = '';
  8.         $tag_class .= !empty($align) ? " {$align}" : '';
  9.         $tag_class .= !empty($color) ? " {$color}" : '';
  10.  
  11.         ob_start(); ?> 
  12.                 <h1 class="<?php echo $tag_class;?>"><?php echo do_shortcode($content); ?></h1>
  13.         <?php $output = ob_get_clean();
  14.         return $output;
  15. }
  16. add_shortcode('h1', 'h1');
  17.  
  18. ?>
RAW Paste Data
Top