Category Archives: Web programming

How to Unit Test a CakePHP Console (Shell) Command — An Example

Wow, it sure took me a long time to find an example of how to write a unit test for my CakePHP console (shell) commands. There’s no how-to in the CakePHP documentation, and the only blog post I could find … Continue reading

Posted in CakePHP, Testing | Leave a comment

What’s the deal with wp_enqueue_style (and why does WP documentation suck?)

I’m implementing a child theme for the WordPress template twentyfourteen. I followed the simple directions at WordPress’ Child Themes page. Yet my styles were not showing up. Not only were they not overriding the parent styles, Firebug showed that they … Continue reading

Posted in CSS, Webmastering, WordPress | Leave a comment

Ical and Daylight Savings time in PHP

The film festival I volunteer for is usually in February, but this year it takes place during the same weekend as the switch to Daylight Savings time. Years ago I built a link on each detail page that lets you … Continue reading

Posted in Debugging, PHP, Web programming | Leave a comment

function dry(){echo “Do not repeat yourself”;} dry(); dry(); dry();

Jumpy Thumbnails It was a snowy Saturday morning and I didn’t have a lot of pressing matters, so I decided to track down a silly issue, off the clock, for a client of mine. On two similar pages, the space … Continue reading

Posted in Refactoring, Web programming | Leave a comment

CakePHP logoutRedirect is not the same as loginAction

If you go through the CakePHP Auth example tutorial, you’ll end up with two (not three) configuration settings in your AppController > components > Auth settings. They will look like this: public $components = array( ‘Session’, ‘Auth’ => array( ‘loginRedirect’ … Continue reading

Posted in CakePHP | Leave a comment

CakePHP Auth->allow only works on actions, not controllers

If you follow the CakePHP documentation on Authentication, you might end up with this line of code in your AppController.php file, in the beforeFilter() method. $this->Auth->allow(‘view’, ‘index’); … And that’s fine for demo purposes. But that actually allows all view() … Continue reading

Posted in CakePHP | Leave a comment

WordPress “recent posts” file to be included on another page

I have a client who finally asked for something I told him we could easily do. He wanted the recent posts from their blog sub-site to be listed on a sidebar on their main site. We wanted a dynamic list … Continue reading

Posted in Web programming, WordPress | Leave a comment

Chrome shrinks images in table cells

Chrome shrinks images in table cells! That was my accusation while working on a WordPress site. The images were correct in Firefox, but in Chrome, they got shrunk down to thumbnail size. I checked the styles for widths, table-layout, anything … Continue reading

Posted in CSS, WordPress | 31 Comments

A photo album with CSS controls for previous and next

A client who owns a salon wanted a change to her web site. She used to have pictures of stylists and styles. So on Amanda’s page there was a picture of Amanda, and 1-3 pictures of hairstyles that she had … Continue reading

Posted in CSS, Design, Mobile | Leave a comment

Make a proper favicon for your web site

Sunday is my website cleanup day. My error logs looked clean, so I decided to finally make a proper favicon for my primary web site. I remember being surprised to learn that the .ico format allows you to store multiple sizes … Continue reading

Posted in Images, Webmastering | Leave a comment