New Tag Cloud

I have sort of moved towards Web 2.0. If you look to the top of the sidebar, you’ll see that I have a tag cloud. Whoopee.

The plugin is New Tag Cloud from FunnyDingo and is a piece of cake to install: unzip to the plugin directory, navigate to sidebar.php, add in the following line of code:
<?php
newtagcloud_output(array('maxcount' => 10, 'bigsize' => 18, 'smallsize' => 10, 'step' => 2, 'sizetype' => 'px'));
?>

wherever you want it to appear and then add tags to your posts.

And that’s it. Except to say that the code as shown on the site uses the backtick as shown on the key by your escape key. Use the other one, the vertical tick, or it isn’t true PHP.

Advertisements

Posted on 18 November, 2007, in Blogging/WordPress, Computer Stuff, Site News and tagged , , , . Bookmark the permalink. 22 Comments.

  1. for me, it’s not a side bar but a bottom bar.

  2. On the main page or on this page?

  3. just this page. Regular front page is still good.

  4. Yeah, I get that too. I’ve left a message for the theme designer because I can’t see what’s causing it.

  5. I was curious, right clicked to view source and loaded the link to the CSS and see this for your sidebar:

    #sidebar{
    float:left;
    width:190px;
    margin:0 -230px 0 0;
    padding:20px;
    background:#eee;
    }

    Shouldn’t the float be “right” instead of left? I just think it’s by coincidence something on the main index page is pushing it off to the right side. I’d try that but as it seems like the most obvious reason it’s maybe not rendering properly.

  6. I don’t think it’s the float: left or float: right that is causing the issue but because the width + margins is probably too much ( > 100%).

  7. float right pushes it to the bottom right, reducing to 90% doesn’t change the position though – it’s still at the bottom.

  8. Yeah, it’s probably a combination of both. I’d say use float right, then play with the margins. Really doesn’t make sense to me to have a sidebar that floats “left” but is intended to be on the right side of the page.. 😉

  9. Odd. I’ve buggered about with the margins, making them bigger and smaller, done the same with the sidebar but nothing works.

  10. Hi. Looking at the page source, I can say that it’s just a matter of improperly nested html. I see that the comments are outside div#content. Open the single.php file and make sure that <?php comments_template(); ?> goes *inside* <div id="comment"> and the corresponding </div>.

  11. sorry, the comments template should go inside <div id="content"> and the corresponding </div>.

  12. Thanks Srini – I’ll give it a go tonight and let you know

  13. Srini – thanks. Moving the comments template fixed it completely. I will now stop playing with it in case I break something else 😆

  14. Heh, I missed that one. I still think you should change the float though.. kind of strange to have it floating to the left but appear on the right.. remember, I’m always right, no matter. 😉

  15. I changed the float, that’s how it got to the bottom right. So you were only half right 🙂


  16. Yeah, it’s probably a combination of both. I’d say use float right, then play with the margins. Really doesn’t make sense to me to have a sidebar that floats “left” but is intended to be on the right side of the page.. 😉

    Actually drew, it makes sense in certain context. In that, you want the layout of the page to be different from the order of the element in the HTML file. After all, CSS is just about that: arranging the elements of a page in whatever manner you want. So, if you want your content to be indexed first, but you want a left sidebar, using float: left; for the sidebar is a good idea (provided always that the content DIV has a float: right; attribute)

    I hope that makes sense.

  17. Nope, Drew makes sense.. 😉

    Looking at the code though, seems everything is in the wrapper with content, comments and sidebar with their own div tags, so it just seems to make more sense to have it float right to me. Oh well. I’m thinking of a person who’s just staring at the code and not the page as a whole, you see it as “float:left”, most people would assume without looking at everything else, the object will display on the left side, not right. That’s a reason I’m saying it doesn’t make sense.

    If I want you to turn left, I don’t say, turn right cause I meant for you to turn left but stay on the right side after turning left.. 😉

  18. Float: right and float: left have two different objectives drew.

    When you float an object left or right, it’s not in relation to the whole page, but within the frame where it’s floating. So if there is space for a floating object in the left of another object, it will be right in relation to that object, but it will actually align to the left of the frame in which it is placed and not to the right.

    That’s what it’s about.

  19. What I mean is easily understood by this example

    Assume A and B are two floating frames. A comes before B in the XHTML file and A and B float to the left.

    So the output will be:

    A—-B——-

    Now A is float to the left and B to the right, it will appear like this:

    A———–B

    Now A is float to the right and B to the left it will appear like this

    B———–A

    Now both are floating to the right

    ——A—–B

  20. Hari, I know, you don’t have to explain. I’m just being sarcastic in a sense. 😉

  21. I know you know a lot about web and CSS, Drew, but I wanted to inform the people who weren’t aware of the issue… It is confusing, you’re very correct. i had a lot of trouble with floating frames until I really experimented a lot.

  22. wow great code, it is really easy to install.

%d bloggers like this: