Posts Tagged ‘Web Design’

Quick And Easy Thumbnail Grids For Wordpress

Posted on: November 12th, 2009 by Andy Gillette 7 Comments

Everybody loves a good grid. I’ve had more than one client looking to get a clean grid of thumbnails into Wordpress, so I decided to share with the world one of my favorite methods.

First, let’s get the grid.  We’re going to save a lot of time by going to the Variable Grid System.  For our purposes, let’s set the column width to 150, the number of columns to 5, and the gutter width to 30.  This will give us a 900px wide layout (it will even fit on my tiny little netbook).

The Variable Grid System is your new best friend

The Variable Grid System is your new best friend

Now, download the file and save it as ‘grid.css’.  I’m going to assume you’ve already got Wordpress installed somewhere and have access to the theme files.  If not, go here.  If so, open up the header.php file and add some code to include this awesome new grid.  You should probably put it next to the declaration for the other stylesheet(s), just to keep things nice and tidy.  You should have something like this:

<link rel="stylesheet" type="text/css"
    href="<?php bloginfo('template_directory'); ?>/grid.css">

Save that header.php and head over to your Wordpress admin panel. There are a few plugins devoted to creating thumbnails, but it’s relatively easy to do with custom fields (which definitely won’t conflict with anything else you’ve got going). So, first off, get your thumbnails ready (i.e. make some images that are 150px wide, or use ones you’ve already uploaded and crunch them to fit), and go edit a post or add a new post and then scroll down and add a custom field called “thumb” and put the url of the image in the value field.

Adding custom fields is painless, see?

Adding custom fields is painless, see?

Do this for a few posts, otherwise the end result is going to be pretty underwhelming, and then open up whichever theme file you want this to show up on, let’s assume index.php. Inside the loop we want to add code to grab the thumbnails and spit them back with a link to the permalink for that thumbnail. The grid part, you might recall, is already taken care of. To get the thumbs we’ll be using the get_post_meta tag. The code looks like this:

<img src="<?php echo get_post_meta($post->ID, "Thumb", true);?>" />

All we’re doing is grabbing a meta tag, that we just created, called “Thumb” based on the ID of the post we’re on in the loop and putting that in the src attribute of our image. For the grid we set up the naming conventions are pretty simple. A div with a class of “grid_1″ will be 150px wide with 15px margins on either side and floating left, a “grid_2″ will be 330px wide with 15px margins, etc. And all of this goes inside a div with class “container_5″, which basically means the grid goes 5 across (or 900px) before it forces a new line. Just to make this as easy as possible, here’s what your final loop will look like.

<div class="container_5">
  <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <div class="grid_1" id="post-<?php the_ID(); ?>">
      <a href="<?php the_permalink() ?>" rel="bookmark"><img
 src="<?php echo get_post_meta($post->ID, "Thumb", true);?>" /></a>
    </div>

  <?php endwhile; else: ?>
  <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
  <?php endif; ?>

</div>

And that’s that. A beautiful grid of thumbnails in 30 minutes or less.

Content Is King: or Why I Build (almost) Everything In Wordpress

Posted on: November 10th, 2009 by Andy Gillette No Comments

I don’t particularly like ‘content.’

I mean, on the one hand, I love content.  We all do.  It’s what makes a website more than just a CSS file.  But I don’t want to be in the business of creating content for my clients, unless they’ve hired me specifically to write for them, in which case I don’t particularly want to be in the business of designing for them.

I push Wordpress pretty hard when I take on new web projects for this exact reason.  I want to be able to design something that will look great all the time, no matter what the client decides to do with the site when I’m gone.  It’s kind of how the web works.  Everything is a “blog” in one way or another.  There are no static websites left, or at least, not many.  And nobody is in the mood, especially now, to pay someone an hourly rate, or a monthly retainer to be a “webmaster.”  And who could blame them?  It’s the nature of technology that as it becomes more ubiquitous it becomes easier to use and more multi-talented (or maybe it’s the other way around – it becomes more ubiquitous because it’s easier to use, etc.).

HTML has been around for 20 years at this point.  It’s extraordinarily well-understood, and it’s difficult for anyone to graduate high school in America, let alone college, without getting at least some rudimentary introduction to web development.  This may leave something to be desired, but the point is that people are a lot more comfortable running their own websites than ever before.  And I, for one, think this is awesome.

I started working with CMS’s as a selling point.  It’s easier on everyone if the client maintains some level of control over the site.  It allows the client to have a fresh site every day, if they want.  At the very least it means that their content can always be up-to-date.  It also means that I don’t have to confine myself to one industry, or one type of client.  I don’t necessarily need to know anything about what a company or a person does to be able to make a site that works well for them.  Good design means I need to have an idea of who they are targeting and what they want to get out of it, but I don’t need to be an expert in their field.  They can handle that part.

And it saves a lot of time and headaches.  If you’ve ever worked in a big company, you understand how decision by committee works.  It’s extremely frustrating as a designer, but that process is just as ruthless on content.  If a client is paying me to put the words on their website, we’ve inadvertently opened up a huge can of worms.

I recently helped out a friend of mine with a site for a college, a medical school, actually.  The short version is: he hired an off-shore team to develop his design and what he got back was kind of a mess.  In the days and weeks following when he showed them the beta site that his team had developed and when I helped him clean it up so it matched his initial designs, the client came up with massive amounts of content changes.  All of these doctors at the school had competing ideas about what should go where and whose name goes in what order on such-and-such pages.  Unfortunately, this site was not built to be particularly smart or dynamic.  If it was we could easily have softened the blow by pointing out that every department could just have a TA or whoever update the pages as they saw fit.  Instead, we ended up going back and forth for another month.   It was a lot of ‘ctrl+f’ in these ridiculously verbose PHP files (half of which were in spanish).  I will never do that again.

So if you are a web designer and you haven’t caught up yet, go read this article and learn to love Wordpress.  You know what they say: once you go dynamic, you never go back.