How to turn off captions in WordPress 2.6

Having fun with new technology

Turn off da captions, turn off da funk!

I’ve found that many who found my previous article about removing caption from the All In One SEO Pack are interested in disabling the WordPress 2.6 captions altogether. This is very simple to do.

Futureproof way to disable captions

From Otto:

Add this to your theme’s functions.php file:
add_filter('disable_captions', create_function('$a','return true;'));

[Edited: Updated with final solution from Otto]. Thanks to King Rat and others who’ve contributed to solving this problem.

If you have any questions, revisions, or…comments, leave a comment!

Remove [caption] shortcode from All in One SEO Pack in WordPress 2.6

Starting in WordPress 2.6, they’ve added captions to images that are automatically generated and use the Shortcode API to make it happen.  One side effect is that All in One SEO Pack isn’t set up to strip the caption from the automatically generated META tags, so you may end up with in your description.

Thanks to a WordPress Trac entry, I got the right regular expression to strip all shortcode in All in One plugin. Continue reading “Remove shortcode from All in One SEO Pack in WordPress 2.6″

Creating a Real Estate Website in WordPress — Part 2

Real estate website screenshot

If you find this article helpful, please share it, or Digg it!

In Part 1 of Building a real estate website in WordPress, you learned about a plugin called FreshPost that we used to set up the basic structure of your real estate website.  Using this article, you will be able to display a single listing page that has all the content your real estate website will need. Continue reading “Creating a Real Estate Website in WordPress — Part 2”

Tableless, accessible, nearly validating osCommerce — Rewriting the beast

Rocky Mountain Baggers

osCommerce accessibility stinks

osCommerce default installation is a huge mess for accessibility. Every piece of code that the platform spits out has endless tables and poorly coded HTML — finding your way through the code is like trying to clear brush.

The simple solution to osCommerce accessibility is to install the Simple Template System and put together a XHTML/CSS’ed out template.  That only solves one part of the problem, however, because your wonderful template is going to be wrapping around a whole slew of undesirable code.

Over a year ago, a client of mine wanted an osCommerce website. I wanted to create a masterpiece of accessibility. I tackled osCommerce head-on and re-wrote most of the code that creates the HTML.  It was a nightmare, but I created a nearly validating eCommerce website with osCommerce.

The experience was so scarring that I haven’t yet written about it 🙂 Nearly every file was affected, so upgrading it would be a nightmare, but it’s truly an effort of love.

KWD presents: a nearly validating, tableless osCommerce website

Continue reading “Tableless, accessible, nearly validating osCommerce — Rewriting the beast”

Get medium image size in WordPress

This is for everyone who’s been trying to find out how to get the medium image size of a post attachment in WordPress:

You’ve got to send the function the ID you’re trying to get the medium images for.

$medium = wp_get_attachment_image_src($picture->ID, 'medium', false);
$med_url = $medium[0];
$med_width = $medium[1];
$med_height = $medium[2];

There are a lot more things you can find out by analyzing wp-includes/gallery.php.

How I fixed WP-DownloadManager 404 errors

Lester Chan's header
I use LesterChan‘s Download Manager plugin, and it’s great. Good interface, simple purpose. 

I recently found out that after upgrading a client’s site to WP 2.5, WP-DownloadManager was no longer working.  I followed the documentation on the plugin website, including resetting the permalink structure, but nothing worked.

For some reason the re-write wasn’t working properly: all the downloads were giving 404 errors.  I couldn’t figure it out, so I dove into the code.  I found the part of the plugin that rewrites the download links, and found the problem. Continue reading “How I fixed WP-DownloadManager 404 errors”

Load time improvements

Load time matters

Imagine waiting 18 seconds for a page to load (on a high-speed connection) — not just the home page, but any inside page of a website.  Pretty frustrating, right?  Having bad load times makes a huge difference to your customers.  I helped a new client reduce page load time from 19 seconds to 3 seconds.

Continue reading “Load time improvements”

Building a Real Estate Website in WordPress – Part 1

Introducing IDX+, the best WordPress real estate plugin

I am designing and creating a real estate website with WordPress, and I’m going to be writing a few articles that detail how it’s done.  This article will get you started — please leave feedback with any questions or topic requests for the next installment. Real estate using WordPress Part 2 is now available!

A little background — why use WordPress?

I’m working with a Denver company on a real estate website. Their goal is to showcase their listings in an easy-to-update CMS.

I’ve worked with Open-Realty, and — to say it bluntly — it’s a huge pain in the ass.  When you scratch the surface of OR, you begin to realize how cobbled together it is. Customizing the code to work as it should requires a steep learning curve.  The templates are relatively simple to work with, but the administration section is horrible.  The Open Realty user experience is just awful.

WordPress is my CMS of choice currently, and it’s so easy to develop for that I recommend it to many of my clients. Continue reading “Building a Real Estate Website in WordPress – Part 1”

Use .htaccess to make all your HTML files PHP

Note: the following will not work on all server configurations, which may be why you’re using SSI in the first place. Call your server administrator/tech support and see if the following techniques are supported.

Escape static HTML

If you want the power and flexibility of PHP but don’t want to (or can’t) shift away from HTML, you can actually tell your server to read all HTML files as PHP by making one simple change to a file called .htaccess.

Here’s how:

  1. Create a file called .htaccess if you don’t have one already, and save it to your root folder
  2. Add one of the following pieces of code into your .htaccess file. Depending on your server configuration, one or the other should work…you’ll just have to try them out to see which one works for you:
    • AddType application/x-httpd-php .php .html or
    • AddHandler x-mapp-php4 .html .htm
      AddHandler x-mapp-php5 .html .htm
      (thanks to Florent V. below) or
    • <FilesMatch ".s?html?$">
      SetHandler application/x-httpd-php
      </FilesMatch>
  3. Save the file and upload it to your server.

Now, you’re able to use all of PHP’s goodness by adding one line of code!

For GoDaddy.com

GoDaddy-hosted websites should use AddHandler x-httpd-php5 .php .shtml .html .htm instead.

Exploring and learning: Are you taking alternate routes?

Denver Map

When you first move to a new city, you aren’t familiar with the roads. You buy a map to help guide you, you ask Google how to get you from here to there most efficiently, and you stop and ask people directions.

After you’ve lived in the city for a while, you become familiar and confident. You start to understand the road naming conventions, the north/south corridors that are the fastest, the quickest way downtown from your location.

The more experience you have with the city, the better you understand how to arrive exactly where you want to without running into any snags. But yet, there’s always more to learn.

Like a city, every profession has its own learning curve. Are you exploring past your comfort zone?

Continue reading “Exploring and learning: Are you taking alternate routes?”

Cars and Code – Not all that different

Customizing under the hood

I was talking with one of my clients who is a mechanic, and he was telling me about how he used to do a lot of car customization and performance enhancing, and that he really loved it.He told me that the problem with customizing cars is that when you start tinkering around under the hood, every little change presents new problems that need fixing, and soon, the project becomes unmanageable.

I’ve done my deal of modifying code (check out this custom XHTML osCommerce installation) and let me tell you: it doesn’t pay. My clients generally don’t care about how the site is tableless, CSS/XHTML valid, et cetera. They want to know that it works properly.

WordPress is beautiful and talks sweet to me.

WordPress is my dream in that regard: it’s beautifully coded out of the box so that creating templates is a logical, simple project. They make functions such as is_page() that allow you to simply ask “Is this the page I think it is?,” then continue to make progress. WordPress is my love. I will continue to be her bedfellow codefellow.

Both my mechanic client and I agreed: customizing is great fun, and very personally rewarding in the end. However, it’s a huge pain in the ass, and the rewards rarely (if ever) equal the effort.

Multiple Matte Colors for CSS Sprites

Here’s the problem: I want to use CSS Sprites for transparent images, and they require different matte colors.

The promise of CSS Sprites is great: you can combine many small images into one bigger image, and use CSS to reveal only the revelant parts. But what if you have a background image, and the background changes color on :hover? When trying to save the smilies, you can only choose one matte color. I need multiple matte colors!

The issue really is a pain when you have already given your object a stroke. Using the Appearance panel, we’ll make everything happy in the world again!

I want the three smileys to be combined as one

Continue reading “Multiple Matte Colors for CSS Sprites”

How to "Hack" VonageMe™

Integrating Call Me Link into Your Website

VonageMe™ is a new service from the VoIP service Vonage. If you have service from Vonage, you should have a VonageMe account.

How to set up click to talk using Vonage

Vonage uses a simple form to enable the calling feature. Instead of using their form, you can style your own…or you can create an anchor link using the following pattern:https://me.vonage.com/username?fromnumber=12223334444For me, that code translates to https://me.vonage.com/303zachary?fromnumber=13035551212

Three steps to VoIP fun!

  1. Go to me.vonage.com and sign in using your Vonage account login (this is to confirm you have the service).
  2. Fill in their information if you want, but it’s not necessary—you will see why next.
  3. Create a HTML form on your website with a text input with id/name “fromnumber” and the form action as https://me.vonage.com/username, with username being your Vonage username.

The final code:

<form action="https://me.vonage.com/username" method="post">
<fieldset><legend>Call me now</legend>
	<div>
		<label for="fromnumber">Your phone number</label>
		<input type="text" id="fromnumber" name="fromnumber" size="12" />
		<small>( 1 + area code + number ). No dashes or spaces, please.</small>
	</div>
	<div>
		<input type="submit" value="submit" />
	</div>
</fieldset>
</form>

Next steps for even better results

Using simple form validation Javascript, you will be able to weed out people who use dashes and spaces in their phone numbers, or even better, create a script to automatically reformat them. View Update below.

You can try the code out on my website as it’s currently formated. It uses the exact code from above, but replaces username with my Vonage username, 303zachary.

Update:

I’ve used the Adobe Spry Validation Widget to make sure that the phone number is properly entered. Below is the code to ensure proper number formatting:

var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "phone_number", {format:"phone_custom", pattern:"10000000000", hint:"Sample: 13033620451", useCharacterMasking:true});