Advertisement
shakil97bd

Simple shortcode query

Aug 18th, 2014
484
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. *************Simple shortcode query ******************
  2.  
  3. //simple shortcode query >>>>>>>>>>>>>>
  4.  
  5. function counter_shortcode($atts, $content = null) {
  6.  
  7.     //add attribute
  8.     extract( shortcode_atts( array(
  9.         'title' => '',
  10.         'icon' => ''
  11.    
  12.     ), $atts, 'counter'));
  13.    
  14.         return'
  15.        
  16.         <!--Your content here-->
  17.        
  18.         ';
  19.  
  20.  
  21. }
  22. add_shortcode('counter', 'counter_shortcode');
  23.  
  24.  
  25. //For call shortcode in index.php
  26.  
  27. <?php echo do_shortcode('[counter title="Testimonail" icon="user"]');?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement