SHARE
TWEET

tags-cloud-shortcode-wp

tolikpunkoff Jan 20th, 2017 115 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function taglist_shortcode($atts)
  2. {
  3.     extract(shortcode_atts(array(
  4.               'type' => '',          
  5.         ), $atts));
  6.     $ret="";
  7.    
  8.     if ($type=='topic')
  9.     {      
  10.         $args=array (
  11.             'smallest' => '15',
  12.             'largest' => '22',
  13.             'number' => '0',
  14.             'format' => 'list',
  15.             'echo' => '0',
  16.             'taxonomy'  => array('category'),
  17.             );
  18.         $ret=wp_tag_cloud($args);
  19.     }
  20.     else
  21.     {
  22.         $args=array (
  23.             'smallest' => '8',
  24.             'largest' => '22',
  25.             'number' => '0',
  26.             'format' => 'list',
  27.             'echo' => '0',
  28.             'taxonomy'  => array('post_tag'),
  29.             );
  30.         $ret=wp_tag_cloud($args);
  31.     }
  32.     return $ret;
  33. }
  34. add_shortcode ('taglist','taglist_shortcode');
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top