Advertisement
firoze

Using the WordPress wp_tag_cloud

Jul 20th, 2015
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. // Quick Tip: Using the WordPress wp_tag_cloud() Function the Right Way
  2. source link: http://code.tutsplus.com/articles/quick-tip-using-the-wordpress-wp_tag_cloud-function-the-right-way--wp-26334
  3.  
  4.  
  5.  
  6. // functions.php
  7. function my_cloud($echo = false) {
  8. if (function_exists('wp_tag_cloud'))
  9. return wp_tag_cloud();
  10. }
  11. ***************************************************
  12. // where you want to use / show /display in your template
  13.  
  14. <div class="mycloud">
  15. <?php echo '<h3>Popular Tags</h3>'; my_cloud();?>
  16. </div>
  17. ************************************************************
  18. // css for style
  19. .mycloud a {
  20. background: #FFC414;
  21. color: #0000FF;
  22. display: inline-block;
  23. margin: 0 4px 8px 0;
  24. padding: 2px 10px;
  25. -webkit-border-radius: 20px;
  26. -moz-border-radius: 20px;
  27. border-radius: 20px;
  28. font-size: 10px;
  29. }
  30.  
  31. .mycloud h3 {
  32. font-style: italic;
  33. font-weight: bold;
  34. font-size: 30px;
  35. color: #FF00FF;
  36. font-family: Comic Sans;
  37. }
  38. **********************************************************************************
  39. // for more example visit
  40.  
  41. // Quick Tip: Using the WordPress wp_tag_cloud() Function the Right Way
  42. source link: http://code.tutsplus.com/articles/quick-tip-using-the-wordpress-wp_tag_cloud-function-the-right-way--wp-26334
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement