WordPress Themes: Object Oriented PHP Code is Very Important
I’m doing a heavy rewrite of my main WordPress theme that all of my other themes are based on. As someone who has spent a lot of time writing code, one of the things that has been bugging me about WordPress themes is all the duplication of HTML. For instance, if all your pages have a [...]
Tip: Always Comment overflow: hidden; CSS Rules
CSS comments aren’t always helpful, they tend to muddle the code and once you get good at naming classes and ids your CSS should tell a pretty clear story. But one thing that should always be clearly commented is the use of overflow: hidden; This rule is used mostly for a couple of reasons, and almost [...]
Using the WordPress apply_filters Function for Dynamic Content
In a WordPress plugin you can filter many values including the title and content of a post using: add_filter('the_content', 'MyPluginClass::FilterTheContent'); This is pretty handy, but sometimes when you’re writing a WordPress theme you want to allow plugins to add content, not just filter the usual content. Using apply_filters makes this pretty easy because you can call apply [...]
The Real Development Life Cycle
One reason I really wanted to run my own business was to be able to do business and live my life honestly. I have a very honest way of working with my customers, they know I can only give so much time and it may take some time to get what they want. But it [...]
WordPress and PHP have Poor Support for Dates and Time Zones
Today I spent way too much time figuring out how to convert dates and times to different time zones. PHP can barely do it, and WordPress really doesn’t do anything to make it easier. I would love it if someone would just create a simple function like this: $string = format_gmt_time_for_time_zone( 'l, F [...]
Swift Mailer: Awesome PHP Mailer
Tonight was the first time that I needed to write some code for a business that would send email to customers, or at least email that needed to be reliable and feature rich. I looked at the documentation for the PHP mail function and after a lot of reading realized it was not going to [...]
HTAccess RewriteRule, When it Changes the URL in the Address Bar
I have been trying to figure this out for ages. When will RewriteRule change the URL in the browser address bar? Today I read thought the whole Apache mod_rewrite documentation page and I still didn’t know the answer. But after a ton of searching I finally figured it out, and hope to explain it to [...]
Making the body Element Take Up At Least 100 Percent of the html Height
Here was my problem, I had some divs absolutely positioned at the top and bottom of the body element and I needed the div at the bottom to be at the bottom of the window even if the body wasn’t tall enough to reach the bottom of the window. Here’s the solution: * { [...]
Why I Love The Web Standards Acid Tests
I generally design only for the latest browsers. If my code works on the most recent version of Safari, Opera, Firefox, and IE then I’m happy. However, Internet Explorer is such a piece of crap that sometimes atrocious errors on IE7 give me great pause. (As of this writing IE8 was the current browser.) I’ve said [...]