code

Custom size featured image thumbnail with fallback in WordPress

Occasionally you may need to display featured images in sizes other than WordPress’ default thumbnail, medium and large sizes. That’s quite easily solved with the add_image_size() and the_post_thumbnail() functions. Unfortunately, there are still 2 problems to be solved:

  • Some posts may not have images at all, or the author forgets to attach a featured image
  • Previous posts don’t have featured images

Here’s a solution that 1) resizes the featured image to the right size, 2) uses the first image in the post if a featured image is not set and 3) falls back to a default image if none of the above are true. Continue Reading

More robust footer widget areas for Headway

I recently got an email from a reader who wanted to know how I implemented my footer widget areas, and seen some similar requests in the Headway forums. With Headway, you can flip your widget areas horizontally to make a widgetized footer but it works best when you only have 3-4 widgets in them. I wanted to have more flexibility and so I injected 3 widget areas into my footer.

Screenshot for posterity, if I ever re-design this blog. Click for full-size image.

I didn’t have time for a full tutorial but hopefully you’ll find these code snippets useful:

blogjunkie.net custom_functions.php for Headway theme

blogjunkie.net custom.css for fat footer widget areas

Solved: Cufon text not refreshing on jQuery UI Tabs

Update: I no longer use Cufon in my projects and prefer @font-face. If you are struggling with Cufon it will actually be faster for you to replace it with @font-face than to figure out your Cufon problems. Start with this tutorial here: The Essential Guide to @font-face

Today I was working on a project that:

  1. Made use of jQuery UI Tabs through the WordPress Post Tabs plugin
  2. Uses custom fonts for the tabs via Cufon
  3. Requires tab font to change color when selected

Continue Reading

Simple form validation with FBJS on Facebook Page Tabs

Today I was working on a custom Facebook Page which included a sign up form. On the sign up form was a checkbox with an id of confirmoptin that needed to be checked before the form could be submitted: Continue Reading

Remove Headway update notifications

As you know I’m a big fan of the Headway WordPress theme. So much so I’ve been using it in client projects.

The one (small) drawback is that Headway puts a notice in the Dashboard every time there’s a new version. For certain clients I really don’t want to have anything to do with them after the project, so I would like to disable the notification. Here’s how.

In Headway’s custom_functions.php, simply add this line:

remove_action('admin_notices', 'headway_update_notice');

Solved. No more nagging client asking me what is this “Headway update thing”.

Follow

Get every new post delivered to your Inbox

Join other followers:

%d bloggers like this: