Wordpress

You are currently browsing articles tagged Wordpress.

Broken Links

I just broke all your links to anything other than this blog’s pages (home, quotes, reading, about). Sorry. The new autosave putting gaps in the post sequence annoyed me.

And…. it is 1:30am.

Search lijit for it or leave a comment. I’ll do my best to direct you.

For a while I have meant to do this. Here I am with insomnia, so here goes… I have implemented Gravatars for the this Blue Zinfindel theme.

Here is coding I used to implement it to this theme’s comments.php (WP Design > Theme Editor > Comments). Normal text is for context. Bold is what I added.

<li class=”<?php echo $oddcomment; ?>” id=”comment-<?php comment_ID() ?>”>
<?php echo get_avatar(get_comment_author_email(), ‘32′); ?>
<?php comment_author_link() ?>

The first place I saw to provide a function rather than a variable is the weblog tools collection post on gravatars. The above is their recommendation with size 32 image. I picked this size because it is the size of the icon inside the WP admin (tested 64, 48, and 30 with 30 seeming about right).

Once I decided to do it, it took me about an hour to find an example using get_comment_author_email() instead of $comments or $id_or_email. It’s easy to implement.

Gravatars

Probably I missed or didn’t understand the announcement.

For the past month or so, I’ve noticed all these comments with the poster’s picture next to it on various blogs. I knew them to be Wordpress blogs. I noticed my own WP had some default icon in the admin user interface. Today I finally put it all together.

A recent Wordpress version incorporated Globally Recognized Avatars into the main code. (They are also known as GRAvatars) Using a hash on the email address, it locates a Wordpress commenter’s 96×96 picture for including in the comment. Naturally, you need to register your email account with the gravatar service.

So, now many of you get to see my ugly mug!

Zemanta Pixie

In posting a comment to a friend’s Wordpress blog, it came up with the error:

Error: This file cannot be used on its own.

I was responding to a comment, so I doubted that he broke his blog between making a comment and my response. So I went looking though my own install. Essentially, at a shell I used

find . -exec grep -l "This file cannot be used on its own." {} \;

to locate the file involved is wp-comments-popup.php. This file contains code which checks for the HTTP_REFERER variable has specific values equal to the path and file name for the comments page. If this is not the case, then it should throw this error. The file mentioned in the error is wp-comments.php.

Its seems that I had configured my web browser not to pass the HTTP referrer to web servers, so the check failed and threw this error.

Maybe the Wordpress developer who designed this has no idea about the ability of web browsers not to send a referrer. Searching for the error on the WP site yielded nothing. From the tons of comments about people hitting this error, lots of people turn off sending referrers.

Solution for those leaving comments: If you attempt to leave a comment and see this error, then enable referrers. Wordpress actually has a decent article on enabling HTTP referrers for a number of different pieces of software.

More friendly error for WP blog owners: Edit wp-comments-popup.php. Change

die (’Error: This file cannot be used on its own.’);

to

die (’Learn how to <a href=”http://codex.wordpress.org/Enable_Sending_Referrers”>enable HTTP referrers</a> to fix this. ‘);

Fixed Blogroll

Apparently this Wordpress template is ancient?

It was using a really old call to display the blogroll. Modified the template to use wp_list_bookmarks and suddenly you can see the categories again.

New Theme

Using a new theme. I’m too lazy to make of my own. :)

Blue Zinfandel is a 2 or 3-column Widget-ready theme, made especially for online newspapers or magazines. Blue Zinfandel WordPress Theme