Bootstrap Templates Bundle

Monday, December 29, 2014

Progress bar: Making short code in Bootstrap Wordpress

Add this code to your functions.php file ---------------------------------------------------

function progress($atts, $content = null) {
 extract( shortcode_atts( array(        
          'percentage' => ''
), $atts ) );

return '<div class="progress">
  <div class="progress-bar" role="progressbar" aria-valuenow="'.$percentage.'" aria-valuemin="0" aria-valuemax="100" style="width: '.$percentage.'%;">
    ' . $percentage . '%
  </div>
</div>';

}
add_shortcode('progressbar', 'progress');


---------------------------------------------------
How To Use:
 ---------------------------------------------------

 [progressbar percentage="60"]60%[/progressbar]
 [progressbar percentage="70"]70%[/progressbar]

No comments:

Post a Comment

Wokiee React eCommerce Template