Decorative Flower
Her Realm, Personal website and blog of Cole
Jul 08

Spicing Up the WordPress 404

The old WordPress 404 wasn’t any help. I used a fantastic plugin, Smart404, that no longer exists. Thew new one, for whatever reason, shows recent pages, with no regards to relevance or pages. How useless! What’s a girl woman to do? She spruces up her own 404, of course.

The first thing I wanted to do was to show the URL that the visitor intended to go to. To test, I had to come up with a URL that wouldn’t redirect. WordPress will try to match up broken URLs to existing page and post titles, which already takes care a lot of broken pages. A complex URL such as “” shows my 404. WordPress tags themselves won’t show you the intended address, because WordPress registers you are being on the 404 page, so I had to use a little basic PHP to show the URL:

 php $url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; echo $url; ? 

I inserted this inside some friendly text, so my 404s say “It looks like you were looking for [URL].

Next, I wanted to suggest related pages. My now-defunct plug-in was so good at this, and I spend a couple hours looking for a substitute that would essentially turn the URL of the broken link into search keywords. Nothing exists. If you make this plugin, email me and I will reward you well!

Instead, I opted for the next best thing: related posts. The problem is, most related posts plugins look at only the page content, tags or categories, none of which exist for a broken link. So, I decided to simply do some trial and error, to see which plugins would get me the closest and work on the 404 page. I wound up replacing my existing related posts plugin for the blog, too, because who needs more than one? I settled on nRelate, because it seems to do the best job comparing URLs to keyword in posts that actually exist.

I inserted the code into my 404.php theme file like this:

 php if (function_exists('nrelate_related')) nrelate_related(); ?

But I wasn’t done. The last thing that I wanted to enable my visitors to do was to contact me, which was really only duplicating the report an error page that I already have. It’s kind of out of the way, so I figured that some users might be more likely to use it on the actual 404. However, I expect few people to do this. As a webmaster, we have ways to check errors and broken links, this just provides me with a little more information.

I use Contact Form 7, which has both PHP and an in-post shortcode. Because I was editing my 404 page, I needed to use the former, so I added this last chunk to my 404 page.

 php echo do_shortcode( '

' ); ?

The shortcode actually breaks it in this tutorial. Oops, but you can see where I went.

So, now my 404s show the visitor the name of the link and some possibly related entries. If none of those are good, they can at least see the link to use the search bar, which appears on every page. If this is all my fault, because I’m a horrible person, my visitors can let me know via the form. In my opinion, this tutorial makes a much more complete 404 than any default WordPress has ever used.

Psst, I have more tutorials here.

Mar 15


When asked what I was passionate about, I found it hard to answer and what I did come up with didn’t seem significant enough. The truth is, however, I am passionate about people and things that affect them: freedom and opportunity, tragedies–both natural and man-made, the every day things and the once in a lifetime chances. I think it would be appropriate to be compassionate and I could not tell you that I try because, the truth is, I try not to be sometimes. It’s all to easy for me to get swept up in despair because I cannot possibly help everyone or even know where to start.

To help alleviate this despair, I decided that I would stick to what I’m good at. Every day, I would make my loved ones smile and laugh and feel good about themselves and, in my head, these ripples of goodness slowly spread outward and perhaps, just maybe, touch every corner of the world. Nevermind that it’s a sphere.

And maybe along the way I will discover some way that I can contribute in more “significant” ways because I know that saying “I make people laugh” doesn’t exactly sound like ground breaking life’s worth. But don’t let me undercut what I do because I am damned good at it and if I died today, the people I loved would be sad because there life was better for having me in it, for having me to make them laugh.

And that is awesome.

Yet, sometimes, the reality for those who I can’t make laugh hits me like a ton of bricks. And I get angry. Or sad. Or a hysterical combination of both. Because I care. Because I am passionate about people in general, despite my sarcastic and biting sense of humor that may indicate otherwise. That is how I felt when I stumbled across the following:

There is a country where the leading cause of death of pregnant women is murder by a partner. In this same country, more than a million women were raped in 2008 and women are much more likely to live in poverty than men. Local laws don’t protect their right to bodily freedom and integrity; some rape laws even state that once a woman initially consents to sex, she doesn’t have the right to change her mind.

You may have caught on by now — yes, I’m talking about the United States.

Jessica Valenti

average life span of a transgendered person is twenty-three years. The statistic is shocking, until it begins to make sense. Gender non-conformists face routine exclusion and violence. Transgendered people are disproportionately poor, homeless, and incarcerated. Many of the systems and facilities intended to help low-income people are sex-segregated and thereby alienate those who don’t comply with state-imposed categories. A trans woman may not be able to secure a bed in a homeless shelter, for example. Spade writes that just as the feminist movement tended to “focus on gender-universalized white women’s experience as ‘women’s experience,’” the lesbian- and gay-rights movement has focused primarily on a white, middle-class politic, centered on marriage and mainstream social mores.

Meaghan Winter for Guernica

The good news is, there is good news.

Google has stepped up and created a Person Finder page for those who may be missing in Japan. I personally clicked over and stumbled across an entry for someone looking for information about someone in Misawa. I left a little blurb to inform the poster than Misawa AB has reported no deaths or serious injuries. It’s really hard for me to read about what is going on over there right now. It just hits.. a little too close to home but I hope that I have helped.

And despite the political turn that has occurred, people like you and me are stepping up to help others. Like this Tumblr user who want to give rides to women in Virginia who require an abortion but must now travel out of state for the service. Or this user who says (and I paraphrase) “You know what? Abortion isn’t for me but I respect the life of the living as well as the yet-to-live.”

Pro-choice is not pro-abortion. Pro-choice is often far more pro-life than “pro-life” is. I can’t say I’ve ever met anyone who thinks abortion is just fantastic or the new perfect birth control, that’s not how it goes. If you really want a lower abortion rate, put your time and effort into education and health care (you know, programs like Planned Parenthood). No one has any right to tell a woman what to do with her body or anything that’s growing inside of it. No one has any right to put women in danger for a group of cells, especially a group of cells they will later ignore and expect to fend for itself.

SkyWritingg on Tumblr

Also, this guy is awesome:

May 02

This Just In: Marriage Doesn’t Kill You

So I’m doing my first-turned-on-the-computer routine which includes checking e-mail and going through the featured articles on AIM today (otherwise, you know, I’d never read any news) and I come across this post about the pros and cons for marriage between men and women. Essentially, statistics show that marriage has some health advantages and disadvantages for either gender.

Now, I’m not going to get into the “men have a shorter lifespan than women because women suck the life out of them” thing for two reasons. 1) We all know men have shorter lifespans because they don’t take care of themselves. It’s true. 2) Read number 1. But it’s interesting that married women tend to have less stress but gain more weight. And men? Are less likely to have strokes. Marriage offers an anecdote against depression and high blood pressure, too. But an unhappy marriage basically turns the tables and wreaks havoc on your health.

Still, the article is very hetero-normative so I wonder if any of these benefits or risks apply to marriage (including gay marriage) in general or if some of these are particular to straight relationships alone.

Jul 14

My Work is Erratic

A start projects, I start more projects. I finish the projects I started most recently, while my original projects drag on. Hey, at least I “nest” my products according to standards? d= I think it’s partially due to the fact that I like having something to return to, work-wise. I don’t really like being project-less. Still, it frazzles me but what would I do if I weren’t busy making life so complicated for myself?

So the projects I have in the works instead of finishing this site? Moving Reviews by Cole to WordPress and putting up a new layout. Also, updating the featured site page. It’s another one which will make you forget your own misery.

Skip to toolbar