Blog
Wordpress Post Thumbnails
May 18, 2010 | No comment
There is a lot of excitement right now about the new features in Wordpress 3.0 that give it more CMS features. Today I want to tell you about a nifty CMS type feature that is in Wordpress right now ready for you to use. Post thumbnails are an awesome way to add some imagery to your site that is easily managed by users.
Part of the reason isnt so obvious to users is that it is enabled on the theme level. So you must add the following code to your functions.php to enable it:
add_theme_support( 'post-thumbnails' );
After this is added to functions.php login to wp-admin and go the the add new posts screen. You should now see the post thumbnail section on the right hand side like this:
![]()
This means your post thumbnails are enabled and ready to be placed in your theme with this function:
the_post_thumbnail();
Place the template tag anywhere inside the loop to activate it for posts. Now you have a way to easily manage small images as part of your blog posts. It’s great for adding some flavor to your Wordpress site and is easy for your users to manage. Here is the codex section on the_post_thumbnail function. There are tons of options so go nuts!
Linux for Web Development: Server Side Tools
May 16, 2010 | 1 comment
This is part 2 of an ongoing series on using linux for web development. This post will focus on the server side technology used to power everything from simple blogs to powerful web apps.
The LAMP stack is the cores of everything that you build on, so let’s quickly define that for those who don’t already know.
-Linux
-Apache
-MySQL
-PHP
Obviously Linux is what this series is about so forgive me for glossing over that and getting right into Apache. Apache is the most popular open source web server technology so having it installed locally on your development box is great for a number of reasons. You can install it using your package manager on just about every distro. The tricks come after you have it installed and configured. On Debian and Ubuntu you should see this screen when you browse to http://localhost/ after you have it installed.
One thing I like to do on a development box is create a symbolic link to the htdocs directory onto my desktop. Functionally what this does is put a folder on your desktop that becomes your web root for your local Apache installation. This obviously makes it much easier to manipulate the files you will be working with on a regular basis. Here is the magic string to accompish this:
ln -s /var/www /home/user/Desktop
This will put a link to your Apache web directory right on your desktop. You can change the paths to place the link where you see fit.
Now that you have a working web server running and a way to easily move your files in and out of your web root you need some toys to play with. This brings us to PHP and mySQL. In Ubuntu you actually have to install several additional packages to get a fully featured and useful development environment setup. My list of these include: php-mysql, php-pear and php-curl as a minimum. You also will probably need to setup mod-rewrite at some point, as many popular frameworks and CMS packages require it. Here is an excellent guide on enabling mod-rewrite in Ubuntu.
The database of choice for small to medium web apps is mySQL and it is available on most every Linux distro through their respective package managers. The client and server packages are typically separate but you might as well install both for a development box.
One tool that I would be horribly amiss if I didn’t mention is phpmyadmin. This is a great web based development tool for handling mySQL database maintenance and administration. I have heard mixed reviews on using it in production, and I can see it being a potential security issue, but as a development tool it is invaluable!
If you are not a fan of web-based solutions, mySQL offers a few tools for managing your databases and tables. The mySQL query browser and administrator are two separate apps that are cross platform and capable of doing your standard database tasks for web development.
There are many server side frameworks and CMS packages available under Linux that can aid your development. Reviewing all of these would be well beyond the scope of this article but I thought I would mention a few of my favorites.
– Wordpress started as a powerful blogging system and has transformed into more of a CMS hybrid. This is a great way to quickly develop powerful websites.
-MODx CMS is a more robust pure CMS system with many great plugins available and has an active development community.
-CodeIgniter is much more low level than the two systems suggested above as it is a PHP framework and not a simple CMS. It offers flexible MVC code separation and a useful class library for common tasks.
-CakePHP is another framework that is similar to Rails. It automates a lot of the work for creating database apps and has a powerful command line interface that can build a simple web app for you in minutes!
I have a couple more tips that don’t quite fit into any of the categories of this series but seem like they belong in the server side category so here they are. First off is a simple bash alias to start and stop my Apache/mySQL environment. Append these two lines to the bottom of your .bashrc file in your home directory:
alias stopdev='sudo /etc/init.d/apache2 stop && sudo /etc/init.d/mysql stop'
alias startdev='sudo /etc/init.d/apache2 start && sudo /etc/init.d/mysql start'
Now type “startdev” or “stopdev” in a console and it will either stop or start your development environment automatically.
The final trick is useful for cross browser testing, specifically IE and Safari on Windows. I use a Windows XP virtual machine for testing these browsers. The VM software I use is Virtual Box. It is freely available in the repos for Ubuntu and you don’t have to do any other downloading or configuring to get it up and running with a new VM. Just fire up your Windows XP VM and then point one of its browsers to your Apache web server’s internal IP address. You can find your’s with the “ifconfig” command. It is usually something like “192.168.1.99”.
Next time I am investigating the various solutions for editing and creating web graphics on Linux. So stay tuned!
Linux for Web Development
May 2, 2010 | 2 comments
I do my web development using a linux desktop, specifically Ubuntu. I plan on doing a small series of posts about doing web development on a linux system. I am going to start off by listing off the apps i use and a short description of my work flow and then go into more detail in later sections. Here are the main apps i use on my Ubuntu web development system: (more…)
Whats New
April 27, 2010 | 1 comment
Just thought id drop in a short post about what I’ve been up to development wise lately so here we go…..
Went to the OCwordcampthis past weekend and had a great time! Picked up a ton of cool tips and specifically quite a bit about developing wordpress plugins. Hopefully I’ll be doing a lot more of that moving forward. (more…)
Jquery-Tools Plugin is awesome!
March 11, 2010 | No comment
Recently i’ve been spending a lot of time working with jQuery. I am sure anyone reading this by now is already familiar with this great javascript framework and all the wonderful plugins available for it. On a project last month I had to implement the now famous “coda slider effect” (more…)
HTML5 CSS 3 Experiments
November 13, 2009 | No comment
Lately i’ve been doing some exploratory reading on the upcoming HTML5 and CSS3 specs. Here are some of the features im most excited about:
(more…)
Komodo Edit – My Favorite editor
November 12, 2009 | 1 comment
Komodo Edit is an amazing open source scripting editor from Activestate. It’s based on their full featured commercial IDE aptly named Komodo IDE. Don’t get the wrong idea though, Komodo edit is full of useful features for scripting and markup as well as being cost free and open source.
(more…)