Skip to content

{ Monthly Archives } July 2012

Replace Text not in Tags

I wanted a way to highlight search terms on the search results page (the way search engines do), by surrounding the text with <span class=whatever></span>, but simply doing preg_replace($re, '<span class=whatever>$0</span>', $text) replaces things inside any HTML tags as well. There are some solutions on the web, but the simplest one I found involves generating […]

Simplifying the Settings API for WordPress

They suckered me into helping redesign the website for my daughter's school (don't worry—if you're looking at it before July 27, 2012 it's not my design), and they wanted to go with a WordPress site so lots of people could edit it easily. It seemed like a good idea, but it took 4 weeks of […]

Using @font-face

I've been asked to help update my daughter's school website (it's not terrible now, just dated and hard to update), and they have some official "branding" with specific colors and fonts. The colors are easy (though I had to explain to the PR person that just because we have Pantone colors doesn't mean I can […]