Has WordPress slightly lost its Soul?

Which is the more predictable, an empire beginning to crumble, or prophets of doom with nothing better to do announcing it?

There seems to be a rise in plaintive comments from people who put a lot of work into WordPress development, for example, here.

Also, a few glitches on wordpress.com, involving time and effort in recovery hasn’t pleased some. And the introduction by relative stealth of host-controlled Adsense - users always complaining of ad content in opposition to their expressed opinions - seemed disingenuous when Adsense for users was briefly permitted, then firmly rescinded.

“We’re a bit of an underdog,” is less true than it was. The atmosphere is of some discontent. read more »

Simple design: a first WordPress Theme: 1

You want to design a Wordpress theme. You know how to do a web page in HTML, know how to upload files to your Wordpress blog, eg. by FTP, but aren’t sure about the PHP bit. It’s not difficult…

First, design a web page - call it index.html, give it a sidebar and somewhere to put the main content (the posts). Use dummy text to give it some body, maybe courtesy of Lipsum (no, it isn’t real Latin)

Put all the CSS in a file named style.css - it has to be named this. While you’re doing the HTML designing, link to style.css in the usual way in the head of the document

<link rel="stylesheet" href="style.css" type="text/css" media="screen" />

- this will be replaced shortly

You probably should use all the principles of tableless design, but you don’t actually have to.

You’ll probably want to give the page a header and a footer - most blogs have them.

For now, don’t try putting any fancy code in the <head> of your page.

And to make it really easy, don’t use any images yet.

When the page looks right in Firefox, Internet Explorer and Opera, you’re ready for the next step (Although you could just check it validates at this point). read more »

Redirect visitors to your new Wordpress blog

You moved your blog to a new domain name and want to redirect everything still going to the old location to the new one.

This applies only if you still have some control over the old server and can put a .htaccess file in, via the control panel or FTP.

.htaccess commands apply only to the directory in which the .htaccess file resides, and all the directories under it - so it’s by far the best that it goes in the same directory as your old blog left.

The .htaccess file

A plain text file where server directives are stored. The server reads it before doing anything else like outputting a page and acts on its commands.

No name, just a dot and an extension - some text editors struggle with this. If you are creating a .htaccess in desktop Windows, say, always use Notepad, or something simple. And set your file explorer to display hidden files, while you’re doing it.

The basic command is simple

Redirect /olddir http://www.newdomain.com/newdir/

But this will do a temporary redirect (status 302) which search engines do not like - it’s long been favored by spammers, so we need a 301 status code.

Redirect 301 /olddir http://www.newdomain.com/newdir/

(or

RedirectPermanent /olddir http://www.newdomain.com/newdir/

does the same thing).

Mapping the old domain to the new - mod_rewrite.

This requires the PHP mod_rewrite module to be installed and active on your server. It usually is - you can check the php_info in your control panel, or just try it and see if it works.

Again, in your .htaccess file

Options +FollowSymLinks
RewriteEngine ON
RewriteRule ^(.*)$ http://www.newdomain.com$1 [R=301,L]

You need the first two commands to get mod_rewrite going

The ^(.*)$ is an example of a regex, or regular expression. Complicated things, but this one essentially captures a path, any path, into a reference $ which is then used in the second part of the command as $1

[R=301,L] the redirect is to be a status 301 http request and the L is for last command - we’re finished…

Unless you want to redirect all requests, regardless of the page requested, to the index page of new domain, in which case:-

RewriteRule /.* http://www.newdomain.com/ [R=301,L]

That is it - upload the .htaccess to the old server and see if it does what it’s supposed to. (It probably won’t, these things rarely work first time - but stick at it…).

Related resources:

Megaboring, but total explanation of mod_rewrite

(If you’re looking at this tutorial in 800 x 600px the commands have been kept on the same line with non-breaking spaces where necessary - you might need to go up one resolution)

Google-Approved Links

Invent the hyperlink and you have invented the WWW.

Links are the lifeblood of the web, the reason for its existence. Links aren’t sexy and oh-so-very Web2.0 like mashups or collaborative videoblogging, they’re just what it’s all based on. So when you start messing around with hyperlinks (and you happen to be a large corporation based on the hyperlink) you are taking your life in your hands…

First, there was the nofollow business, detailed shortly after its introduction in this article which still holds true today. The nofollow attribute applied to a link would instruct a search engine spider to (largely, but not entirely) ignore the linked page and its content.

We now have the eccentric situation where referrer spam comes complete with its own nofollow attributes already supplied. But, worse, nofollow is proposed to be used as a sign of link sponsorship as opposed to pure, organic links generated by honest endeavour.

Have your paid links by all means, but don’t assign any authority to them - like a TV ad with a celebrity gushing on about their chosen product, but holding up a sign saying, Don’t actually believe a word of it!!!

Taken together with the enhanced “denounce a competitor” scheme, detailed in our previous post, the situation becomes bizarre.

read more »

Google bans Paid Links

Just came across this ridiculous piece of hubris - which would have been a reasonable, if typically heavy-handed, April Fool’s Joke - had it not been published on the 14th.

Google may provide a special form for paid link reports at some point, but in the mean time, here’s a couple of ways that anyone can use to report paid links:
- Sign in to Google’s webmaster console and use the authenticated spam report form, then include the word “paidlink” (all one word) in the text area of the spam report. If you use the authenticated form, you’ll need to sign in with a Google Account, but your report will carry more weight.
- Use the unauthenticated spam report form and make sure to include the word “paidlink” (all one word) in the text area of the spam report.

It is not possible to separate “links sold for traffic” from “links sold for PR” - Google themselves have made sure of that, it recurses to the very basis of their original existence as a search engine (unless you reckon that “traffic” and “authority” have no relationship whatsoever).

WordPress Date Countdown plugin

This for a countdown plugin matches the idea of weblog as diary pretty effectively - works well.

It’s filed under “rants”, so it’s probably tongue-in-cheek, with such gems as money is not why you should be working, here comes this mixture of wisdom and wild generalisations.

Ajax - when to stop

ajax.jpgThe issue of Ajax continues. To be honest right at the beginning - I am not a fan of Ajax. Or rather, not a fan of the fashion for Ajax. It’s an easy trap to fall into - Gopher space was fashionable.

The sidebar widgets scheme of WordPress provides a good testbed for the adoption of Ajax - it has all the salient pros and cons.

It’s excellent if all you want to do is fill in text boxes and shuffle things round a sidebar - flexibility within it’s own terms, absolutely. And, to be pragmatic, this is going to suit 80% of WordPress users. Which is why it’s there.

It’s not great if you want to keep XHTML valid at all costs, or if you wish to make any changes to the default sdout (and this is why the old javascript-less sidebar remains).

To be sure, the situation has improved from when the handling of Ajax by browser was sporadic, and when 30% of visitors complained of being unable to use a site properly. Hardware with less competent browsers, ie, handhelds etc, which are supposed to be the scene of expansion, are going to struggle for the forseeable future unless more thought is given to how pages degrade.

Instinctively, I suspect that that’s enough Ajax for now. I quite like pageloads - they do have their advantages, a nice, clean slate to start with.

Ajax remains dangerous and requires to be used with the utmost caution.

WordPress 2.2 - slight delay

The official release of wp2.2 has lost its date, and has been put back “a week or two”. Fair enough, there do appear to be some significant changes to the core, and it’s good to get it right.

Customizing WordPress posts by Author

You’ve got a multiuser blog and want mugshots of the different proud authors next to their posts - this is how…

The key is to use the template tag the_author_ID()

This returns the numeric value of the user ID for the current post - unlike the category or categories of a post, it’s unique - so the programming becomes relatively simple. See wp-admin/users.php for the values on your blog

In strict programming terms, this is a bit of bodge - or you could say it takes advantages of the unique flexibility of PHP to dip in and out of HTML code. The following block of code needs to go within the Loop of posts on index.php. We are going to switch the value of $image_path according to the value of the function the_author_ID()

<?php

switch (the_author_ID())
{

case 1:
$image_path = ‘http://www.mysite.com/uploads/john.jpg’;
break;

case 2:
$image_path = ‘http://www.mysite.com/uploads/mary.jpg’;
break;

default :
$image_path = ‘http://www.mysite.com/uploads/default.jpg’;
}

?>

Don’t forget the break;

Probably best to use absolute urls in this case, especially if you’re using mod_rewrite seo-friendly urls. And the form of the post will be something like this

<div class=”post”>

<div style=”float:right;”><img src=”<?php echo $image_path; ?>” height=”140″ width=”100″ /></div>

<h2><?php the_title(); ?></h2>

<?php the_content(); ?>

</div>

Further work
For perfection, you might want to use relative locations in the filesystem and check that the photo exists before outputting a broken path, using file_exists()

and, if not, supplying a default that you know does exist.

Also life is going to be easiest if all your photos are the same size - if you don’t want to make your life easy, something like this is the way to go:-

case (2):
$image_path = ‘http://www.mysite.com/uploads/mary.jpg’;
list($width, $height, $type, $attr) = getimagesize($image_path);

break;

But see getimagesize for details

There’s lots more to do with individual authors and their posts…

(These discussions assume some working knowledge of php and how to put it together - the code is given as suggestions, so you’ll need to do a bit more than just a cut ‘n paste to get results for your blog…)

Wordpress Theme - Tarski 1.4

Tarski (a real labour of love) 1.4 is newly released and can be obtained here. We’ve used Tarski on 3 or 4 installations and it does the business.

“Tarski now works right out-of-the-box with WordPress MU. The theme will now auto-detect WPMU and tweak its functioning accordingly; the specifics are in the changelog.”

Many years ago, in another life (Berkeley, USA), I briefly met Alfred Tarski and had to run through some Theory of Groups stuff with him - not especially his field and certainly not mine - he was forbidding, rigorous, irascible, but almost to a comedy extent…