December 20, 2006

WordPress Theme URLs

This is probably unnaturally fussy, but as someone who views server logs on an ongoing basis, I was rather horrified to see the logs of my WordPress sites — the URLs for the theme (design layout) images are horrifically long because the images are buried several folders deep in the WordPress folder. So an image URL would be:

http://developedtraffic.com/wordpress/wp-content/
themes/dev-t/images/someimage.jpg

Yuck. Given that there is additional data on each line in the logs, these lengthy image URLS were causing the lines to wrap around to the next line, and this is on a 30-inch screen. This makes for difficult log viewing. And is much too untidy for ::cough:: me.

This is probably way more fiddling than most people would do (I'd believe that), but I couldn't see any particular reason for keeping the images in the /themes folder; it's not as if they need to be there for your theme to work. Nor does it mean that, if you upgrade, you'll inadvertently delete the folder where you put your images and not notice that your images have disappeared. So I just moved them to the site.com/images folder and updated the stylesheet and template references to them. This gives me something like this, and keeps lines from wrapping around:

http://developedtraffic.com/images/someimage.jpg

Aside from moving the images, here's the code for this. Change this:

<img src="<?php bloginfo('stylesheet_directory'); ?>/images/someimage.gif" alt="alt text" />

to this:

<img src="<?php bloginfo('home'); ?>/images/someimage.gif" alt="alt text" />

This took about 20 minutes or so. I imagine that most people wouldn't bother, or don't view their logs. For SEOs, it's another matter. Is this overly fussy, or what does anyone else do?

~ Diane Vigil

Have your say ...

If this is your first comment, it will be held for moderation (but comments are appreciated). Otherwise, just be courteous, don't drop links unless highly pertinent — and no substituting keywords for your name. Posters must be 16 or older. We use Akismet, so if you don't see your non-spam comment posted, contact me.

Note: unless you're sure of your math answer,
copy your comment [Cntrl A, Cntrl C] before you click submit ...

Manage your subscriptions

Archives
© 2004-2008 DianeV. Web Design Studio - Los Angeles. All Rights Reserved.
27 queries. 0.152 seconds.