Formatting WordPress Tag Cloud

April 1st, 2008 um 2:00 Uhr • Uncategorized1 Kommentar

While the wp_tag_cloud() function is a very cool addition to the WordPress content manager, the widget is not easily customized for layout and design. For starters, the classes generated are completely unique names (read: they are ids in class clothing) and the tag cloud widget does not employ a unique id. Consequently, the use of CSS to conform the tag cloud ul and li tags seems out of the question. When I converted about 200 categories to tags on my personal blog I got the following mess:

Overflowing Tags

Here’s what the code out of the box looks like for the wp_tag_cloud() function:

function wp_tag_cloud( $args = '' ) {
$defaults = array(
'smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 45,
'format' => 'flat', 'orderby' => 'name', 'order' => 'ASC',
'exclude' => '', 'include' => ''
);
$args = wp_parse_args( $args, $defaults );

$tags = get_tags( array_merge($args, array('orderby' => 'count', 'order' => 'DESC')) ); // Always query top tags

if ( empty($tags) )
return;

$return = wp_generate_tag_cloud( $tags, $args ); // Here's where those top tags get sorted according to $args

if ( is_wp_error( $return ) )
return false;

$return = apply_filters( 'wp_tag_cloud', $return, $args );

if ( 'array' == $args['format'] )
return $return;

echo $return;
}

By changing the defaults array I was able to correct my layout problem:

$defaults = array(
'smallest' => .9, 'largest' => 1.8, 'unit' => 'em', 'number' => 75,
'format' => 'flat', 'orderby' => 'name', 'order' => 'ASC',
'exclude' => '', 'include' => ''
);

Smallest” and “Largest” refer to the font size that can be given a unit of either pts or em. I changed mine smallest from 8 to .9 and largest from 22 to 1.8. and the unit from pts to em. If you would prefer an unordered list of your tags (as opposed to a cloud), change the “format” key from “flat” to “list“. The “number” key is the number of tags that will be displayed. Default is 45. I have a ton so I increased my number to 75.

The result of these changes was what I was looking for and would hope that functionality might be eventually built in at least for CSS if not some sort of form for changing the values of the default values in the wp_tag_cloud() function itself. Here’s what my tag cloud ended up looking like:

Corrected Tag Cloud

WordPress 2.5 RC2

March 27th, 2008 um 12:39 Uhr • WordPress0 Kommentare

WordPress is revamping their engine. I like many of the changes.

Finally, the blogroll section is called links which means something to everyone. This is especially helpful when implementing WordPress for sites that are not, strictly speaking, blogs. Clients won’t say anymore, “Hey, I wanted xyz, not a blog…”

The WP team has not added extremely needed CSS for their tag feature. As such I cannot deploy it because I cannot control the styling. “Classes” such as tag-link-10; however, these seem to reflect the category ID (i.e., “-10″ part) and as such are more properly ids and not classes. There is no general way to shape up the tag cloud widget which in my experience easily spills over from sidebars into the page copy itself. While there may be reasons to hard code the font-size into the style attribute, it severely hampers designers’ abilities to customize the look and feel of the site. I recommend using a series of CSS classes that employ a relative font-size and font weight, perhaps even color.

Gmail Updates and Improvements

November 30th, 2007 um 5:40 Uhr • Google, asd Software, asd Web Browsers0 Kommentare

If you haven’t noticed Google has done some major updating and improving to their Gmail internet based free email service.  They have increased the standard storage capacity to over 5.3 GB which is huge and still free.  There is now a group chat feature which allows for multiple people to chat using only one window.

Improved Contacts Interface

While all these things are good, the best and most needed improvement was to their contacts section.  The GUI got a much needed facelift and is very user friendly.  Exporting and importing features have been beefed up and work well.  If you have an iPod and you like to keep your contacts from Microsoft Outlook XP and earlier on it, you now can do that without purchasing third-party software to create vCards of everything.  Google’s contacts will now export in the vCard format.

Better Gmail Plugin Plays Catch-Up - Gmail Contacts Disappear

There is only one glitch for Firefox users.  Aside from the fact that Firefox 2.0.0.10 is increasingly cumbersome, slow to load and crashes more than it ever did, the Firefox plugin “Better Gmail” causes the contacts section in Gmail to blank out and be inaccessible.  The developers of Better Gmail have released two updates in the last week to try and catch up with Gmail’s new interface; but, it looks like they still have some catching up to do.  In the mean time if you would like to enjoy the new Google contacts interface, you will need to disable the “Better Gmail” plugin.  Alternately, Google has provided a link at the top of the Gmail interface entitled, “Older Version” by which you may revert to the old interface in which the “Better Gmail” plugin will work well as it has historically.

Nothing New in Tech Support

October 14th, 2007 um 10:46 Uhr • Humor0 Kommentare

If you’re in the industry or just one who is asked to help people with their computer woes in any capacity you’ll appreciate this YouTube spoof on the Help Desk as it might have played out in Medieval times.

Is it me or is Firefox getting sluggish

October 12th, 2007 um 1:58 Uhr • Software0 Kommentare

Since Mozilla released Firefox version 2.0.0.7 for PC and Mac, I and my colleagues have noticed that the browser hangs often on switching between tabs and even in interacting with elements on a page already active. Firefox has been a great browser and still is, I just hope the trend does not hang on this direction.

My Take on Web Hosts

October 11th, 2007 um 3:29 Uhr • Web Hosting0 Kommentare

Much of my time lately, in terms of blogging on Nielsen Digital, is spent planning and writing the PHP Tutorial. As the material pertains to broader readership, I’ll duplicate those aspects in the main blog as I have with this bit on Web Hosts.

The best web hosting out there is Slicehost. It does require a higher level of set up and aptitude to get going; however, Paul over at Useful Jaja (who now works for Slicehost in some capacity) has a tremendous volume of tutorials that will walk you through everything you need to do in order to get your server up and running. If you want convenience over performance, MediaTemple’s GridServer is an affordable alternative, but it is shared hosting. The advantage to shared hosting is that PHP/MYSQL are likely ready to go when you sign up. The disadvantage is that you share all the resources on the web server with countless numbers of other clients.

Basic Text Output

October 8th, 2007 um 5:50 Uhr • Basic Text Output0 Kommentare

Try this:
<?php echo "Hello world!"; ?>

This will output the following:
Hello world!

Getting Started

October 8th, 2007 um 5:47 Uhr • Getting Started, asd Uncategorized0 Kommentare

There are a few skills or proficiencies I am assuming you have in this tutorial. First, you have PHP and MYSQL set up on an operating web server. Second, you have a basic understanding of HTML. Finally, I am assuming you have some sort of text editor in which you’ll be writing your PHP scripts and that you are able to upload your PHP scripts to that server via some sort of FTP client. If you aren’t quite there yet, let me give you some suggestions so that you can get there.

Web Hosting

The best web hosting out there is Slicehost. It does require a higher level of set up and aptitude to get going; however, Paul over at Useful Jaja (who now works for Slicehost in some capacity) has a tremendous volume of tutorials that will walk you through everything you need to do in order to get your server up and running. If you want convenience over performance, MediaTemple’s GridServer is an affordable alternative, but it is shared hosting. The advantage to shared hosting is that PHP/MYSQL are likely ready to go when you sign up. The disadvantage is that you share all the resources on the web server with countless numbers of other clients.

Getting Up to Speed with HTML

At the present time Nielsen Digital does not have an HTML tutorial, but there are several resources to which we may point you that you may get up to speed. HTML Dog is a good straight forward walk through on writing valid HTML code. It is very important that you can recognize what is and is not valid code. It will save you lots of headaches.

Text Editors and FTP Clients

If you are using a Windows based system there are a ton of good text editors, many if not most of which have a built in FTP client (the program that puts your pages and scripts on the web server so that others can view them). If you are using a Mac, there are not as many choices however the best text editor I have used happens to be for Mac only.

Mac OSX

Coda by Panic ($79-$99) is, as I said, the best one window code writing console of which I know (if only I liked Macs!). I use it at my day job, an institution that uses Macs for in the creative/communications department where I am stationed. It has FTP built into it (as well as SFTP). Other editors of note in order of priority: TextMate (€39 ≈ $57), TextWrangler (free), and of course the over-priced and clunky Dreamweaver by Adobe ($399). Of these other editors, Dreamweaver and TextWrangler have internal FTP/SFTP clients built-in. TextMate works well with Transmit also by Panic.

Windows

Now for machines that transcend trendy: the PC. I use a text editor called Rapid PHP by Karlis Blumentals out of the Germany. You can buy it online and it does include an FTP client and according to Karlis SFTP is coming. If you require SFTP, as I do, I recommend the best file manager ever: Total Commander, by Christian Ghisler of Switzerland. You will need to download the add-on from his site to enable SFTP on Total Commander. Dreamweaver by Adobe also works on PC and you can read about that above. Other editors of note: Aptana IDE (Free), Komodo’s ActiveState IDE ($295, text editor is free), EditPad Pro ($49.95 Pro, EditPad Lite is Free). PHP Editors has a growing review of the myriad other editors you may like even better.

Bucket Explorer and Amazon S3

October 8th, 2007 um 12:47 Uhr • Amzon Web Services, asd File Storage0 Kommentare

As far as Amazon’s S3 web service’s performance, all I have to say is “Wow.” But how does one manage files, get public links for files, and manage permissions without writing your own web app? Answer: Bucket Explorer.

My system

I am running Windows XP Pro SP 2 (current with updates as of today). I use AVG Antivirus, Windows Defender (anti-spyware), and Windows XP Firewall. I downloaded your install file to an external drive and had zero problems installing to my local primary HDD.

Things I liked

Easy install, logical helpful GUI layout. The context menus are also intuitive (ie., I right click and see options that I thought I’d see). The uploading process is fast and it is not a resource hog (like UpRight seems to be).

Things to improve (in version 2007.08)

You’ll want to make sure that you left click on the files for which you want info or to modify before right clicking and selecting an action from the context menu. Simply right clicking on an file does not select it and consequently the actions in the context menu produce no result and no message to let you know what to do. This is certainly not a major issue, but if you know about it before using Bucket Explorer, you’ll have more time to use this very helpful application.

Conclusion

I have had zero bugs or substantive issues with the software. It did everything I expected and needed it to do. Download your copy for Windows or Linux today.

The MediaMax Mess and Amazon’s S3 Solution

October 6th, 2007 um 12:07 Uhr • Amzon Web Services, asd File Storage1 Kommentar

Many of my clients are moving to podcasting or at least want the ability to put audio on their websites. I had used MediaMax as the audio server I would get them set up with. The problem is MediaMax has a habit of not working acceptably for … MONTHS (true even for clients using their paid service)! So I began looking for options that were 1) affordable for my clients for whom audio is not a central component of their web presence and 2) that would be reliable and fast. Enter Amazon S3.

S3 is a simple storage service that is fast, reliable and cost-effective (even for non-profit organizations). I have started moving all my clients off MediaMax and onto Amazon S3. In S3 your files are stored in “buckets” (directories) and many commercial entities are using S3 for their storage (e.g., SmugMug).

Tools for Amazon S3

The only trick in using S3 is that traditional FTP clients generally won’t work with their web service, unless you run Panic’s FTP client Transmit 3 on a Mac. I use both, though prefer my PC and there are options.

UpRight 1.2: Easy S3 Uploading

One tool to give your clients for very easy upload to their S3 space (on a PC) is Otaku’s UpRight 1.2 application. Installation is easy and the interface is user friendly, which is especially important if you are deploying Upright to a less than tech savvy user who has the responsibility of loading the audio or any files to an S3 bucket. This is the case with some of the organizations with which I work. Having a very easy way for assistants to upload files always increases my development productivity.

Edit Amazon S3 Storage DetailsThere was only one trick that did not seem as obvious to me as it could have been when setting up a new S3 Location in UpRight. When you enter your public and private keys for S3 you are then asked for the name of your S3 bucket. If the user has not yet made a bucket, it is not obvious what to do. Otaku does have documentation on their website that helped me. The answer: Just enter the name of the new bucket.

Over all, Upright is incredibly easy to use (and fast). To upload all that is required of the user is to right click the file and then choose the S3 bucket to which they would like to upload the selected file. However, if you need a client that will allow you to browse the contents on S3, you’ll need to try another application. This would be a feature that I would like to see Otaku Software add to UpRight.