Example #1
0
 function widget($args, $instance)
 {
     if ($instance['only_store_pages'] && !mp_is_shop_page()) {
         return;
     }
     extract($args);
     $current_taxonomy = 'product_tag';
     if (!empty($instance['title'])) {
         $title = $instance['title'];
     }
     $title = apply_filters('widget_title', $title, $instance, $this->id_base);
     switch ($instance['tagcolor']) {
         case 'grey':
             $tagclass = '';
             break;
         case 'blue':
             $tagclass = ' label-info';
             break;
         case 'green':
             $tagclass = ' label-success';
             break;
         case 'yellow':
             $tagclass = ' label-warning';
             break;
         case 'red':
             $tagclass = ' label-important';
             break;
         case 'black':
             $tagclass = ' label-inverse';
             break;
         default:
             $tagclass = ' label-info';
             break;
     }
     echo $before_widget;
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     echo '<div>';
     echo '<span class="label' . $tagclass . '" style="padding: 5px; margin: 5px;">';
     wp_tag_cloud(apply_filters('widget_tag_cloud_args', array('taxonomy' => $current_taxonomy, 'separator' => '</span><span class="label' . $tagclass . '" style="padding: 5px; margin: 5px;">')));
     echo "</div>\n";
     echo $after_widget;
 }
Example #2
0
 function widget($args, $instance)
 {
     if ($instance['only_store_pages'] && !mp_is_shop_page()) {
         return;
     }
     extract($args);
     $current_taxonomy = 'product_tag';
     if (!empty($instance['title'])) {
         $title = $instance['title'];
     }
     $title = apply_filters('widget_title', $title, $instance, $this->id_base);
     echo $before_widget;
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     echo '<div>';
     wp_tag_cloud(apply_filters('widget_tag_cloud_args', array('taxonomy' => $current_taxonomy)));
     echo "</div>\n";
     echo $after_widget;
 }