Archive for March, 2011

wp-block as a shortcode

In my last post I raved about the excellent plugin wp-blocks by Keir Whitaker and then went on to extend it a little. Time to extend it a little further, this time by adding a shortcode. Shortcodes are the handy square bracketed code snippets which conjure up more content and functionality direct from a page [...]

Getting a random wp-block by regex

If you’re used to developing with a CMS such as CMS Made Simple, you would be quite used to having blocks of content separate from the main content system. These blocks can be re-used through-out existing content and within the theme templates. One might even consider this a core function for a CMS. Sadly it’s [...]

Mimicking wordpress.com’s image resize URIs

To follow up from last night’s entry, I was determined to remove the intermediary step of my_resize_script.php. I’ve acheived this goal in the mod_rewrite rule, file name and query string now get passed on to timthumb.php. Updated rules: RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{REQUEST_URI} \.(gif|png|jpg|jpeg) RewriteCond %{QUERY_STRING} (w|h)=(.*)$ RewriteRule (.*) /full/path/to/timthumb.php?src=$1&%1=%2&%3=%4 [L] This will pass both [...]

Resize images on the fly without messing with image URLs

[EDIT: I've made this simpler with a follow up post: Mimicking wordpress.com’s image resize URIs] Exporting a wordpress.com site for use on a standalone wordpress.org install is a joy to set up. The export and import system are simple to use and give little or no issues. What is a problem is the automatic resizing [...]

Updating WordPress site URLs for different hosts

Why oh why does WordPress insist on storing the site URLs within the database? Every other project I can think of either keeps it in a config file or doesn’t bother with one and just works with whatever URL it finds itself on. This is most irritating when you have: more than one developer working [...]