0

I need to modify the markup of the tag cloud widget.

Can someone tell me how to go about doing this without modifying any of the files outside of the theme directory so my changes don't get overwritten when updating WordPress?

2 Answers 2

1

What sort of custom markup do you need? Can you elaborate a little more?

6
  • Rather than just have a bunch of anchors, I need to insert them into <li> tags and float the list items so there can several columns.I know I could apply this to the anchors, but I want those to be set to display: inline (since they're text links).
    – user1462
    Commented Jan 19, 2011 at 20:40
  • 1
    <?php the_tags('<ul><li>','</li><li>','</li></ul>'); ?>
    – Pippin
    Commented Jan 19, 2011 at 21:05
  • Then just float the li tags with CSS
    – Pippin
    Commented Jan 19, 2011 at 21:06
  • @Pippin, thanks for the response. This appears to be code to insert for each post. I need to display a tag cloud in the sidebar that contains tags used in all posts. When I tried inserting your code, it didn't print any thing out. What needs to be changed in order for the_tags() to work in the sidebar?
    – user1462
    Commented Jan 19, 2011 at 21:40
  • 1
    @Pippin, Nevermind, I figured out that wp_tag_cloud() needs to be used instead. Thanks!
    – user1462
    Commented Jan 19, 2011 at 21:45
1

If you're looking to change the way the tag cloud is displayed, you can use get_tags() to heavily alter the output and create a custom widget.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.