I’m working on an HTML5 theme for Drupal 7 right now, and I needed to change the meta content-type tag. By default it looks like this: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />, and I needed the updated HTML5 version: <meta charset="utf-8" />. Normally, you can replace these things in one of the theme template files, but [...]
Archives for “howto”
How to use jQuery to open external links in a new window
A common request from clients is to open all external links on their website in a new browser window. (Leave aside for now whether this is a good idea or not, and just assume that you need to do it.) It’s easy enough to add target="_blank" to a link, but there are two problems. First, [...]
How to use jQuery to target CSS at older browsers
On a recent project where I had to support Firefox 3.6, 3.0 and 2.0, I had to find a way to target a specific version of the browser due to differences in the rendering engine. It turns out the easiest way to do this is by using jQuery to detect the browser and add a [...]
jQuery Slide-Down Language Selector
A site I worked on recently had an international link, and when the user clicked on it, the whole page was supposed to slide down and reveal a language picker. I found some jQuery to slide the page down, but it relied on the language picker being the first div on the page. For SEO [...]
jQuery Popup Footnotes
A recent site I worked on had footnote references throughout the body copy, and a corresponding list of footnotes at the bottom of the page. That’s easy enough to mark up, but the client also wanted the footnote to display it a little tooltip-style popup when you moused over the footnote reference. I didn’t want [...]
How to Hire a Front-End Web Developer
The following is an email exchange I had with a friend at another company about a year ago. We were talking about the best way to go about hiring a front-end developer, and I was sharing some tips from our hiring process. “Hi Scott, we are in need of a CSS expert/ninja. Our company has [...]
Five iPhone Tips
I recently got an iPhone, and like any good geek, immediately started banging my head against things I didn’t know how to do. If you’ve had an iPhone for awhile now, you probably already know these, but if you’re a newbie like me, these tips may help you out. Some of these tips will only [...]
How to Convert Your Old WordPress Database to UTF8
When I upgraded my WordPress installation recently, I ran into a chracter encoding problem. Long story short, it turns out that older WordPress installations like mine tend to have been created in latin1, but the data is actually being saved in UTF8. If you update your wp-config file to a newer version, it adds a [...]
How to Avoid Paragraph Gaps when Using Superscript and Subscript
Frequently, when I see a webpage with superscript or subscript text, I see associated gaps in the paragraph. This is caused because the default way browsers render super and subscript text is to add enough vertical space in the paragraph to show them. The result is ugly, but as you can see in the following [...]
How to Convert from Community Server 2007 to WordPress
It’s safe to say that no one at Pop Art was ever really happy with Community Server. We selected it as a platform for a variety of reasons, some of which turned out to be based on faulty assumptions. Once we finally made the decision to switch to WordPress, the conversion was a huge pain, [...]
How to Get Your Most Recent Twitter Posts Using PHP with Caching
When we started redesigning the Pop Art blog, one of the chief requirements was to integrate everyone’s Twitter feeds into the site. In addition to the Pop Art Twitter feed in the sidebar, we wanted to add individual twitter feeds on the profile pages. The problem is that the javascript code that Twitter provides can [...]
Moving from LiveJournal to WordPress
I’m working on a new site for a local author, and one of the things she wanted was to move her blog from LiveJournal to WordPress. I did a bit of research, and found out that there are a few complications. LiveJournal’s export tool will only export a single month of entries at a time. [...]
How to Make VirtualPC and Synergy Get Along
Recently, I installed VirtualPC on my XP box so that I could still test IE6 after installing IE7. However, I immediately ran into a problem. There is some sort of conflict between the mouse emulation being done in the VirtualPC window, and the mouse emulation being done on my PC to let me use my [...]
How to Search for This and Not That Using TextWrangler
I’ve been doing a ton of search-and-replace operations at my job lately, and one of the worst ones I did had to do with searching for the word “Comfort.” Unfortunately, this word is absurdly common on this site, and I was getting well over 1000 matches, most of which didn’t apply. Now, the first thing [...]