how to rotate taglines on your WordPress blog
Another thing on my todo list was to learn PHP and write a WordPress plugin to randomly select quotes stored in the database to rotate the tagline.
An admin interface to create, modify and delete quotes was planned for Version 2.1 (beta) due Q4 2008.
Fortunately for me though, a helpful person called Zombie Robot (pseudonym ?) has already produced wp-quotes (and another kind person tweaked it to work properly for taglines).
All that remains is the interesting part - performance tuning. No - wait. Existing users have already identified this modification as efficiently fetching a single, random record. Horribly database specific of course but worth having when you have 2.4 million quotes.
36c36
< $sql = "select * from " . WP_QUOTES_TABLE . " where visible='yes'
< order by rand() limit 1";
---
> $sql = "select * from " . WP_QUOTES_TABLE . " where visible='yes'";
References & mentions
-
…endly sitemap. I also modified the 'page.tpl.php' template to reinstate my wonderful, award winning rotating tagline (or slogan in Drupal terminology). Curiously, I haven't enabled the D7 core 'blog' module a…
-
…ever created for WordPress. You start taking ProPlus, pulling all-nighters and, unbelievably, start hacking PHP code. Then, I grew up and became a man. I bought some slippers from M&S together with a pipe an…
-
…is very interesting how all this happened shortly after my brilliant idea to introduce the rotating tagline. Of course, you know what this means, blog. We're going to have to move house (again). Prestigious,…