Below you will find pages that utilize the taxonomy term “WordPress”
June 24, 2012
Updating a WordPress database with new domain details
Further to my original quick db update queries, I found the need for a more in-depth approach.
A WordPress site my father works on has weekly backups, but he wanted to see that they actually worked.
To do so, I set up a subdomain vhost on my bytemark server and set about getting the back to work with it.
One of the most annoying/lazy/strange things about WordPress is that it uses serialised arrays within database fields.
read more
March 21, 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 or post content.
The wp-blocks plugin is currently intended to work with the theme template files in PHP.
read more
March 18, 2011
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 missing from WordPress. Keir Whitaker has been working on this missing option and gives us wp-blocks.
read more
March 7, 2011
Mimicking wordpress.com’s image resize URIs
To follow up from last night’s entry [Resize images on the fly without messing with image URLs]](/2011/03/07/resize-images-on-the-fly-without-messing-with-image-urls/), 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 width and height variables into timthumb if they are declared.
read more
March 7, 2011
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 of images that wordpress.com offers.
One can insert an image in the normal way and then append the image URI with some variables such as width (w) and height (h).
read more
March 3, 2011
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 on the same project more than one system for hosting the project (dev, test, live, etc) One way to cope with this irritation is to have a collection of .
read more