Dave James Miller

Developer. Computer Geek. INTJ.

Month

January 2011

Get the domain name from a URL for display purposes in PHP

This is a very simple function to convert a user-supplied URL to just the domain name. Read More

Automatically enable plugins in new WordPress Multisite blogs

There are three options (that I know of) for automatically enabling a plugin in new sites. Read More

Automatically generate subdomain for new WordPress Multisite blogs

When you create a new WordPress Multisite blog from the admin area, you have to enter three things: Site address (subdomain or folder name), Site title and Admin email... Read More

Set site/plugin options for all blogs in a WordPress Multisite network

I used this code snippet as part of a WordPress Multisite plugin, to allow me to quickly set some options for all blogs in the network. Read More

List of all blogs in a WordPress Multisite network

This code was used to generate a menu showing all blogs on a WordPress Multisite installation. Read More

Alternative to the_category() in WordPress that works correctly with nested categories

The WordPress function the_category() doesnt work particularly well when you have hierarchical categories. Read More

Set default category / tags for a new WordPress post using links

I used this code to automatically set the default post title, category and tags for a new WordPress post based on which link was clicked. Read More

Force additional categories to be added to a WordPress post on save

On one WordPress blog I have categories for "Starred" and "Archived", in addition to the real categories. I hacked this together to make sure the posts would still go into Uncategorised as well. Read More

Toggle category with ajax in WordPress theme (frontend)

This is a follow-up to Toggle “Starred” Category in WordPress – making it more generic and usable for multiple categories. Read More

Set default theme for new WordPress Multisite blogs

Even if you disable all but one theme, WordPress seems to default to TwentyTen when creating a new Multisite blog. The fix is simple though – add this to wp-config.php. Read More

Prevent WordPress sending any emails

I did this simple hack on a private WordPress Multisite blog, to stop it sending me emails every time I created a new blog. It’s definitely overkill to stop all emails, but unfortunately I couldn’t find any hooks that let… Read More

Winter Onederland

Christmas & New Year 2010/11

© 2017 Dave James Miller — Powered by WordPress

Theme by Anders NorenUp ↑