Advertisement
kobial8

Tags Widgets Dynamic with Custom Style

Mar 11th, 2015
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.53 KB | None | 0 0
  1. Step 01: Just add the tags widget from wordpress. It will look awful!
  2. Step 02: Add the following code in functions.php
  3.  
  4. // Customize font-size of tag cloud widget
  5. add_filter('widget_tag_cloud_args','set_number_tags');
  6. function set_number_tags($args) {
  7. $args = array('smallest' => 9, 'largest' => 9);
  8. return $args;
  9. }
  10.  
  11. Step 03: For better look, Add the CSS code in style.css:
  12.  
  13. .tagcloud a {
  14. background: #3486BC;
  15. border-radius: 2px;
  16. color: #fff;
  17. display: inline-block;
  18. margin: 2px 0;
  19. padding: 5px 10px;
  20. text-decoration: none;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement