Featured Posts

<< >>

Customizing the Custom Loop – Wordcamp NYC 2012

So this past weekend was my first Wordcamp.  Thanks again for everyone who attended. As a recap, I’d like to compile all the information Jeff and I went over into

Baking a Cake

For the two weeks or so, I’ve been dabbling with CakePHP, which has been something of a painful experience.  My pain comes from meshing my PHP experience into a Rails

Places It’s Tempting To Use Display: None; But Don’t

This is a rather interesting article about how the display:none css property may not be the best solution, especially when you consider web accessibility and screen readers. Places It’s Tempting To Use

Error establishing database connection WordPress on Mac OSX Lion

I’ve recently gotten my hands on a new-ish iMac with a freshly installed copy of Lion (as opposed to my 6+ year old macbook which has seen so many versions

Dusting off the old web site

It’s sad how infrequently I get a chance to write on my own blog, having created a few for others in my day.

As a point of catch up, I’ve been a bit busy with Wayward Raven stuff, having done a few epic convention tours all along the East Coast, and helping to get our Kickstarter off the ground.

Signed C: #2 is totally funded by the way!

Other than that, been up to my eyeballs in JavaScript and HTML5 Audio. I’ve been having some headaches getting the audio tag to do much of what my Flash Dev colleagues have been able to do in ActionScript.

Read this article and started sobbing into my hands: http://html5doctor.com/html5-audio-the-state-of-play/

Probably a bit out of date, but the information is fairly relevant.

Back to the drawing board…

Customizing the Custom Loop – Wordcamp NYC 2012

So this past weekend was my first Wordcamp.  Thanks again for everyone who attended.
As a recap, I’d like to compile all the information Jeff and I went over into one central location, for easy review.
Defining the problem
So, like many people first staring with WordPress, you’ve probably made it through the five minute install, and then look at your screen and think, “now what?”
WordPress is great in that it gives you 90% of what you need to create a fully manageable site, but for that 10 % more, you need to do some work if you want to do something custom.
In our example from Wordcamp, we ended up creating a Super Hero Gazette, showcasing upcoming super hero movies.  To that end, we created some interesting features.
  • Featured Post sections
  • Branded Category Boxes
  • Alex’s Reviews (the most trusted name in comics)
  • Picture of the Day
  • Publisher Breakdown
Each of these sections taps into built in WordPress functionality, but gives it a little nudge; the Global Query
The Global Query
Tools of the Trade
Performance
Try it at home
Get the code and theme:
https://github.com/jmarx/Wordcamp-NYC-2012

Baking a Cake

For the two weeks or so, I’ve been dabbling with CakePHP, which has been something of a painful experience.  My pain comes from meshing my PHP experience into a Rails frame of mind, which is essentially what CakePHP is.  PHP on Rails if you’d like, though, it doesn’t do all of what I’ve come to expect from rails.

Migrations are something I miss, though I’ve been seeing some progress on that front on GitHub.

Another thing I’m having trouble getting my head around is that I’m using PHP to write Rails-ish concepts and code, which is weird. Normally I don’t have this problem with context switching, but I find my Ruby brain being overpowered by my PHP brain.

Like Rails, it works best to define a default database config file, and Cake does this for you in the config directory, where you get a database.php.default, instead of the database.yml file in Rails.

Again, it’s these little things that get you.  From what I’ve seen, you can make CakePHP more Rails-like, but the way I see it, if you need to write Rails or Ruby, use Ruby on Rails.

CakePHP is a great product, despite some of the gripes I’ve seen.  If you want to do some rapid prototyping, but need to use PHP, such as if you’re a PHP shop, or that’s your strongest language, go bake a cake.

Here are some useful links to get you started:

http://book.cakephp.org/2.0/en/tutorials-and-examples/blog/part-two.html

http://net.tutsplus.com/tutorials/php/getting-started-with-cakephp/

Places It’s Tempting To Use Display: None; But Don’t

This is a rather interesting article about how the display:none css property may not be the best solution, especially when you consider web accessibility and screen readers.

Places It’s Tempting To Use Display: None; But Don’t | CSS-Tricks.

Error establishing database connection WordPress on Mac OSX Lion

I’ve recently gotten my hands on a new-ish iMac with a freshly installed copy of Lion (as opposed to my 6+ year old macbook which has seen so many versions of the kitty branded OS, it now LoLz all the time) and found that setting up a local WordPress Multisite dev environment to be somewhat tricky.

Out of the box, Lion comes with all the goodies you need to run a php/MySQL project, but nothing is ever in the right place.

Case in point, enabling apache is as simple as going to System Preferences > Sharing > Web Sharing, and Boom, you have a local web server running.  Just go to http://localhost/ and you should see the traditional apache “It Works!” message.

A simple change to your http.conf is all you need to get PHP set up, provided you can find it. Any Apache guru will tell you it varies from system to system, and OSX lion is no exception.

For those not in the know, it’s at /etc/apache2

After setting that part up, I had many issues with permissions, but this may not affect you, as I was working in a high security environment, and the image was totally locked down.  You don’t want to know what I had to do to get local admin rights.

Once I had apache and php set up, MySQL was pretty straight forward. Just go to MySQL’s download page and get the DMG. Setting up was a breeze, so I should have realized something went wrong.

I went ahead to start the WordPress 5 Minute Install and got stuck on the config.

No matter what I did, I kept getting this odd error message in my log files:

“Error establishing a database connection”

…and…

Can’t connect to local MySQL server through socket ‘/var/mysql/mysql.sock

I searched the interwebs for various articles, thankful I wasn’t the only one to get caught up by this issue.  The good folks over at foolswisdom.com had a really good article about this database connection issue.

In short, the php.ini file was looking for mysql.sock in /var/mysql/mysql.sock, but the file itself was installed under /tmp/mysql.sock

A quick change to the php.ini file and I was all set.

Related Articles

http://smartwebdeveloper.com/mac/httpd-conf-location-mac

http://foolswisdom.com/mac-wordpress-error-establishing-a-database-connection/

http://support.apple.com/kb/ts1999

http://www.mysql.com/downloads/mysql/

http://www.perfectline.ee/blog/how-to-setup-apache-and-php-on-mac-os-x-snow-leopard

http://akrabat.com/php/setting-up-php-mysql-on-os-x-10-7-lion/

Back to basics

So I’ve been working on some WordPress goodness for an unnamed multinational for some time and have been realizing that my own work has been rather embarrassing. Read more

Pages Tutorial for WordPress

Pages tend to get overlooked by bloggers, who focus more on posts and updates overall.  To help those new to blogging, I’ve come up with a simple tutorial on how pages work in WordPress.

Enjoy! Read more

Posting Tutorial for WordPress

I’m often asked to go into some details about how posts work with WordPress.  To that end, I’ve created a more in depth look at the posting process, and how to use them from start to finish.

Read more

WordPress Basics Tutorial

For those of you who may not be in the know, I’m a web developer.  One of the platforms that I do quite a bit of work on, is WordPress.  You may have seen a plug-in or two with my name on it, as well as a few blogs I’ve built using the platform.

I keep getting asked many of the same question by my users, and I’ve decided to roll them up into various tutorials and instructions, in easy to consume videos.

I’ll be posting them onto the site as they come out, and without further ado, here’s the first one after the jump.

Read more

The Last Gig by Norman Green

Just found out that one of my favorite writers recently came out with a new novel. Why haven’t I heard this yet?

Damn you Internets!

Anyone still feel like buying me a belated birthday gift?

The Last Gig by Norman Green