Life Codecs Ruminations. Reflections. Refractions. Code.

February 24, 2009

Theme Redesign!

Filed under: general — Tags: , , — Kamal Advani @ 10:33

I got sick of the fixed-width default theme, so I took the WordPress classic theme (which was variable width, what an improvement!), and replaced it with my colors! Whew! Thank God for CSS. I then proceeded to apply the same colors (not yet uploaded) to the main site! Enjoy, funnily enough, the dark colors are a lot easier on the eyes when writing code.

– Kamal

February 17, 2009

WordPress’ Tag Cloud Limit

Filed under: how to,software dev — Tags: , , , — Kamal Advani @ 04:34

So I got sick of wordpress seemingly not updating my tag cloud – after googling – turns out the tag cloud is limited to 45 items, and the admin interface (using WordPress 2.7.1 at time of writing) has no way of updating it. If you wish to up this limit, you:

  • Navigate to /path/to/wordpress/install/wp_includes
  • Backup the file widgets.php as widgets.php.orig in case you mess up (and no I did not).
  • Edit widgets.php, around line 1867 you’ll find a function wp_widget_tag_cloud($args) which looks like so:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/**
 * Display tag cloud widget.
 *
 * @since 2.3.0
 *
 * @param array $args Widget arguments.
 */

function wp_widget_tag_cloud($args) {
        extract($args);
        // [... snip ...]
        echo $before_widget;
        echo $before_title . $title . $after_title;
        wp_tag_cloud(); // REPLACE ME!! ME!!! (and no this comment did not exist in the source)
        echo $after_widget;
}
  • Replace the commented call (can you guess which one?) with:
    wp_tag_cloud(array(‘number’ => 78))
    replacing 78 with the no. of tags you want to display.

If you’re so inclined and have shell access to your install, you can instead apply this patch which sets the number to 101, my setting, and if your file is different (say due to a different version of wordpress), it probably will fail :P.

Enjoy. I’m going to tag this post, among others, with ‘tag’, bet you didn’t see that coming ;).

– Kamal

Powered by WordPress