May 21, 2012

Howto Move a WordPress 3.0 Site

When developing this site, and it’s sister sites ecomsmith.com & gosatchmo.com, I decided to use the new multi-site feature of WordPress 3.0.  Everything went great during development.

What I did was to develop using a local address of “blogs.dev” as my base site, and then add all the other sites using the WPMU features.  So I had coderseye.blogs.dev and ecomsmith.blogs.dev as well.

All was great, until it came time to make the sites live.  I did what I used to do.  I dumped all my data from the database, opened it in an editor, and replaced “blogs.dev” with the live domain name that is acting as the master control for this site.

It worked!  Sort of.  It showed my blogs, but I couldn’t login.  WordPress kept complaining about needing cookies enabled.  But … but … they are enabled!

Fixing it took a bit of trial and error. [Read more...]

Technorati Tags: ,

Modifying Widget Titles in WordPress

On a recent project, my client wanted graphical headers for the widgets on her WordPress blog. Unfortunately, widgets are not that easily themed. Nor can you do this in CSS.

The internet was no help. Lots of people were suggesting using a “dyamic_widget_params” filter. Nope, that isn’t what I want. I don’t want to modify before and after the title, I want to actually change the title.

But, with some poking around, I figured it out. It’s actually pretty easy.

[Read more...]

Technorati Tags: ,

Running WordPress on Lighttpd

I’ve finally moved the site to a new server.  My new host is a 1 gig slice at SliceHost, which will be hosting all my sites (yes, I really need a 1 gig slice) from now on.

One of my big goals was to completely drop Apache.  I just don’t like that server.  Ugly to configure, huge, slow & bloated.  I much prefer Lighttpd for my Django & Satchmo projects, but I hadn’t ever tried using it for PHP.  Today I bit the bullet and started the transition.

[Read more...]

Importing WordPress to Banjo

Thanks to Andy C I’ve finished the WordPress import script for Banjo.

That article gives instructions for direct SQL loading of a somewhat different blog database. I couldn’t use it directly for Banjo, partially because I’m through with using MySQL. I just can’t take all the UTF problems any more. I’ve gone all PostgreSQL all the time.

So my solution needed to speak MySQL and then directly create objects in Django. That way it could be used for any target database.

[Read more...]

Multi-blogging for WordPress update

adapter Multi blogging for Wordpress updateOne of the first post on this site was Multi-blogging made easy. It is a common desire, to set up WordPress for multiple separate blogs with only one master install. That way updating the blog is much simpler, with files only in one place.

My technique works perfectly, but I’ve had to tweak it a bit over time to make it completely compatible with newer versions of WordPress. The latest version takes care to make separate directories for each site’s cache. Without that, sometimes WP gets a bit confused.

Enjoy:
setup_multiblog.zip

[tags]wordpress,multi-blogging[/tags]

Fixed a WordPress Feedburner Replacement Bug

ant Fixed a Wordpress Feedburner Replacement BugThis morning I logged into Feedburner to check my stats. AAAARGH! 0 subscribers on all my blogs. Seems my upgrade to WordPress 2.0.3 broke the feedburner redirect plugin.

How to fix it

I experimented for a while, and came up with this surefire fix:

  • Login as admin, go to plugins

  • Disable the Feedburner replacement, then re-enable
  • Go to options, then Feedburner.
  • Disable the redirection
  • Click the Feedburner tab again, and re-enable
  • Click "activate"
  • Now edit your .htaccess file on the server.
  • Change this line:
    RewriteCond %{HTTP_USER_AGENT} ^FeedBurner.*$

    to this:
    RewriteCond %{HTTP_USER_AGENT} ^Feed.*$

[tags]wordpress, wordpress2.0.4, feedburner, bugs[/tags]

Activating Akismet anti-spam plugin

love hands Activating Akismet anti spam pluginIf you are using WordPress, and you aren’t using the built-in plugin “Akismet”, are you insane? Or are you a bit confused about that API Key thing you need?

See, you need that plugin. Or at least you will once the comment spammers find you. It is a shared comment spam catcher. The more people who use it, the more effective it becomes. Most importantly, it is incredibly good at its job. In the last couple days on my blog, Akismet has stopped over 30 spams with no false positives. It only missed one, and that one was extra-tricky.

Getting your API Key, step-by-step

  • Go to wordpress.com.
  • Click on Get a wordpress blog now.
  • Signup, don’t worry about the name, since you aren’t going to use the blog. It is free.
  • Once you are signed up, go to your admin pages, and click on the “users” tab.
  • At the top of the users page, it shows your API key!
  • Copy that key.

Activating Akismet

  • Go to the admin pages for your soon-to-be-spam-free blog.
  • Click on “plugins”
  • Click “Activate” on Akismet.
  • Now, click on “Akismet configuration” at the top of the plugin page, just below the main tabs
  • Paste your api key.
  • Enjoy a mostly spam-free blog
  • Go and review/delete your spam from the manage admin tab every once in a while.
  • Laugh at the silly spammers with your awesome one-click deletion powers!

[tags]blog spam, comment spam, akismet, wordpress[/tags]

Related Posts plugin modifications

adapter Related Posts plugin modificationsI’ve been delaying using a related entries plugin because it didn’t fit with my normal way of posting. See, it uses a WordPress custom field "keywords" to do its matching. That’s OK, but I already have all my posts marked up with inline keywords, for the Technorati plugin Simpletags.

So, when I have an itch for long enough, I scratch it. So, I’ve written an extension to the related-posts plugin which reads keywords from the post text inside [tags] [/tags] markers. In other words, it leverages the use of the Simpletags plugin. You can see it in action by clicking the post title of any entry on this site.

I’ll be submitting the code additions to the original plugin author, but I don’t know if he’ll take them, since it is sort of an edge-case. In the meantime, feel free to comment here.

Here’s my modified plugin: Related Posts Mod 2.02.

Related posts

Technorati Tags: , , ,

What is it about PHP

weeds What is it about PHPI’m no fan of PHP, I believe it is a terrible language which produces insecure, ugly code almost all the time, yet I use it. It powers this blog, for example, and it will be powering the online store I am about to launch. Why do I use it when there are so much better languages and frameworks available?

Ian Bicking discusses this at length, focusing on the features he’d like to see in a serious competitor to PHP. He’s got some great points and a long laundry list of things he’d like to see, but his article doesn’t answer my basic question. Why do I use a language I personally think is extraordinarily poor?

Installation & Availability

That’s it, right there. Installation is king. Installing a PHP app is usually as simple as dropping the files in place and setting up the database. Bam, done. PHP is PHP, it usually “just works”. There is no careful setting up of fast CGI, or debating about Apache vs. Lighthttpd. There are no awkward CGI interfaces to tweak for your particular installation. Just drop and go. That is half the battle right there. And, I believe, it is a lot of the force that drives the second half of the winning equation, availability of “good enough” applications.

Availability. Name a better, more configurable, more active blogging framework than WordPress written in a good language (note, this does not include Perl). Ah, there are some, but they need work, they need to be finished, or “just need this part implemented”. I don’t have time or the interest. I run a couple businesses, and have a full time job. I have a lot of programming projects to do, and writing a new blogging engine isn’t one that interests or will pay me. So, WordPress/PHP wins.

Kinda sad, really, but it least it isn’t .net. PHP is bad & ugly, not evil.

[tags]PHP,rants,wordpress[/tags]

3 Column template with good Adsense placement

swim lanes 3 Column template with good Adsense placementThe Three column style for WordPress weblogs is getting very popular. With all the billions of interesting plugins available, and with the increasingly common use of ads on the sites, it is hard to fit everything in on a standard two-column design. Despite that, there really aren’t that many templates available which are both stylish and effective.

My Favorite

After much searching, I recommend 130106 by Isnaini. It does a nice centered “pop” of the Google Adsense, which I find very effective.

For examples, there is the host site, of course. I don’t care for the pink-brown on that site, so another (prettier) example site using that theme is my marketing site, Marketer’s Eye.

[tags]Wordpress,Wordpress2,3 column,template,themes,3 column template[/tags]