wordpress tag cloud font size

Discussion in 'WordPress' started by kcvale, Oct 3, 2008.

  1. #1
    I want to change the font size of my tags in the sidebar. My brother is legally blind and he can't see the smaller tags at all so I thought I'd make them a little bigger. I found this code to make the change but don't know where it goes.

    wp_tag_cloud('smallest=10&largest=16&number=45&orderby=name&format=flat');

    Can someone tell me which file it goes in and it's position in that file?

    This is driving me crazy. So far, I've remembered to make copy of my files before I tinkered-- I've gotten some really strange errors with some very peculiar results. Thought I'd better get some help before I did something fatal :eek:

    thanks,
    kc
     
    kcvale, Oct 3, 2008 IP
  2. craiger22

    craiger22 Well-Known Member

    Messages:
    1,472
    Likes Received:
    99
    Best Answers:
    0
    Trophy Points:
    170
    #2
    I believe that will need to go in your template where you want them to be shown. But be sure to include the php tags.

    <?php wp_tag_cloud('smallest=10&largest=16&number=45&orderby=name&format=flat'); ?>
    Code (markup):
     
    craiger22, Oct 3, 2008 IP
  3. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yeah, maybe your strange results were due to missing PHP tags ( <?php ?> ).

    Tag clouds can go anywhere but they usually go in the sidebar (sidebar.php) or footer (footer.php). To add a tag cloud to the sidebar of the default Kubrick theme, open themes\default\sidebar.php and place the cloud code between the other sections, like this:
    
    <?php wp_list_categories('show_count=1&title_li=<h2>Categories</h2>'); ?>
    
    <?php wp_tag_cloud('smallest=10&largest=16&number=45&orderby=name&format=flat'); ?>
    
    <?php /* If this is the frontpage */ if ( is_home() || is_page() ) { ?>
       <?php wp_list_bookmarks(); ?>
    
    Code (markup):
    You can find out more about them here:
    Wordpress Template Tags - wp_tag_cloud
     
    Cash Nebula, Oct 3, 2008 IP
  4. craiger22

    craiger22 Well-Known Member

    Messages:
    1,472
    Likes Received:
    99
    Best Answers:
    0
    Trophy Points:
    170
    #4
    I dont think he was dropping it in the template files. If he were dropping it in the theme then the fact that he didnt have the php tags would just mean it would process as html. This wouldnt throw an error code.
     
    craiger22, Oct 3, 2008 IP
  5. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Who knows? :) He doesn't mention error codes, just "errors" and "peculiar results" which can mean anything really.
     
    Cash Nebula, Oct 3, 2008 IP
  6. kcvale

    kcvale Active Member

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    86
    #6
    Thanks for the help. The errors were syntax errors when I tried to drop the code in the sidebar.php. The last one was syntax error, unexpected T_ENDIF which I got rid of. And I was able to insert the code without any obvious errors.
    But my tag font size is still the same size -- tiny. Is there something else I need to do to get the tag font to change size?

    Thanks,
    Kay (aka kcvale) :eek:
     
    kcvale, Oct 3, 2008 IP
  7. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #7
    The default font unit is points, so the smallest tags are 10-point which is very small.

    Try increasing the values of smallest and largest, like this:
    <?php wp_tag_cloud('smallest=16&largest=26&number=45&orderby=name&format=flat'); ?>
     
    Cash Nebula, Oct 3, 2008 IP
  8. kcvale

    kcvale Active Member

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    86
    #8
    Yes, I tried increasing the font sizes but it had no effect.
     
    kcvale, Oct 4, 2008 IP
  9. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Then we'll need a link to this website to see what is going on.
     
    Cash Nebula, Oct 4, 2008 IP
  10. kcvale

    kcvale Active Member

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    86
    #10
    Right now, I have it on my local server while I work out the kinks. When I get it up and running I'll post back. Thanks for all the help. :)
     
    kcvale, Oct 5, 2008 IP