Solution for query_posts() Breaking Things & Causing Havoc

According to my experience and WordPress support forum entries like , the very powerful and useful WordPress function query_posts() breaks several other features like search, next post/previous post, and maybe more. Ugh.

A client wanted their blog post page to show entries only from the current calendar week starting on Monday. So if it was Thursday, the index page would show posts from the last four days, Monday-Thursday. If there ever was a mission for query_posts(), this was it.

$weekstart = date("W");

(Put that above The Loop. It uses PHP’s date() function to get the current calendar week’s first day, which by definition and luck happens to be Monday.)

Fine, but hold on: search broke. A search would return nothing. Who was the culprit? Why it’s query_posts(). I was shocked, shocked (sarcasm).

Here’s how I got around it: I figured if I could make search use another template, one without the offending function, I’d be fine. I looked into that but didn’t find much (didn’t spend too much time looking though). Then I had a better idea: don’t move search, move the index page.

  1. create a new template with your troublemaking query_posts() on it, name it Home
  2. create a new page, give it the Home template
  3. in Admin -> Settings -> Reading set Front Page Displays Static Page -> Home
  4. return the template file index.php to its original state, or at least take off query_posts()

That’s it. Search works because it’s not using the offending template. Home works becuase I get to keep query_posts() on it to display the week’s posts like the client wants. Everybody’s happy.

Tags: , ,

Open Letter to Music Industry PR

Because of my two music sites RMMB and NWMB, I get a daily a ton of emails from music industry public relations people. The emails come from everybody — from the bigtime Atlantic Records to part-timers at Seattle’s tiny Light In The Attic Records.

When I get a PR from someone and it says the magic words “here is a song you can share with your readers” BING I’m 1000X more likely to put that on my music sites. Why? Because I can embed the song in the blog post. One click and you’re listening to the song.

It’s the first/only thing I scan for in PR emails. It offers so much more than the tired MySpace page link that takes someone off my site.

Sorry if that comes off that I can’t stand MySpace (I can’t) and think it’s tailored to 8-year-olds (I do).

What I’m trying to get accross is this: give me content, not links. If you’re writing press spam, think about what you’re writing. Keep it short and simple and give your audience what they want. Send a personal email every now and then, and start it with the recipient’s first name. Easy, thoughtful. You’d be amazed at what a simple REAL email means in a sea of mindless press email blasts.

Tags: ,

What Ad Sizes Should I Accept from Advertisers?

Any you want. My advice, however, is to stick to standard sizes because when advertisers come to you, often they’ll already have a standard size ready to go. That means you can just start running the ad and not worry about having a graphic artist/web dev squeeze stuff into your non-standard sizes, then have that approved by both parties. This has happened to me, and it’s a drag.

When potential advertisers say “what sizes can I run on your site?” I say “any of the industry-standard sizes Google themselves run.”


What Fonts Can I Use on my Website?

Play it Strict!

This is the very strict set, compliance is almost guaranteed if you choose one from this list. Choose and forget.


I bend that rule a little and use Century Gothic (all caps, in green) on my Volvo Forum

According to, Century Gothic is available to 86% of Windows web users (probably higher on Macs). To me that’s fine, if I go for every last user on Earth at 100% compliance not only is it a chore, but the fun gets sucked out of it.

Whatever the case, all browsers have a “fall-back” font (“Times”, etc.), and in between any font you pick and that font you can define your own fall-back fonts. Personally I think Georgia can look fantastic in designs. Arial Black and Trebuchet also can look better than they look “on paper”.

More ->


Blog Post Indexed Within 30 Minutes

I almost coughed coffee out of my nose when I noticed Google had indexed a blog post on my Volvo site in 28 minutes. Maybe less, I wasn’t checking for this specifically.

Why? There is probably a myriad of reasons why Google pays close attention to my site, but the biggest are these:

  1. MVS has been up for years — it’s trusted as a Volvo authority and thus gets Google attention.
  2. It has a site map. A site map is a simple text file that sits on the server and is meant for search bots, not humans. It tells search bots what’s where, and what’s new.
  3. I publish content constantly. The more frequent your posts, the quicker search bots come around to see what’s happening at your site.

Tags: , ,

Linking in WordPress

The link and unlink icons in WordPress

I got an email today from a client asking how to make words in his blog go to other sites. Good question! He was talking about creating “links”, also called hyperlinks <- there’s one.

The button on the left is the link button, the other is the unlink button. Those appear in the WordPress editor’s toolbar when you are composing a blog post.

How to Link In WordPress

1. write something
2. highlight the word or words with your mouse
3. click the link button
4. enter a URL (must start with “http://”)

You’re done. To unlink, highlight the word(s) and click the unlink button.

When you publish that blog post, the word(s) will take the user to whatever URL you put in. The word(s) will usually be underlined, which is the universal convention to identify a hyperlink.

If you’re talking about writing on an older version of WordPress, or a non-WordPress blog, it should work the same way, or very similar. This is a standard used for over a decade in all kinds of computer programs.

Tags: ,

How Can I Get More Website Traffic?

Traffic levels are all about content. People ask me about SEO… should they do some SEO basics to their site? Well yea! Do the basics of SEO and promote your site.

I’ve never asked a webmaster if he’s doing everything he can to promote his site and gotten a “yes”.

Real world, online, whatever. If you don’t have your URL in your signature, get it in there! If you don’t hold your website in high regard, nobody else will.

But most importantly, write good content as frequently as possible and users will come. If you can do only one thing do this.

That’s why it’s important to have a site where you can write without noodling with HTML. This is where WordPress comes in, and it’s why I’ve recommended WordPress for probably 19 out of the last 20 websites I’ve consulted on.

Tags: , , ,

Google AdWords: Reducing your Bids

Hint: you may be able to buy clicks for less than before. I’ve found that I’ve been able to lower most of my bids to HALF of what they were and get the same number of clicks. True story.

It’s the economy: there are now fewer competitive bids out there chasing terms.

Tags: , ,

How to Transfer a Domain Name

This is how to transfer from any registrar TO, who I consider to be sane, competent and trustworthy. I’ve had an account with them since 2001. Here’s my Web Hosting essay for more background about them.

1. go to your current registrar and log in with your account credentials
2. look around for how to transfer the registration, and initiate it; you’ll get a “transfer authorization code”
3. go to
4. click Register a Domain Only
5. fill in the stuff, and you’ll probably have to pay $9.95
6. click “I already own a domain” and enter the transfer authorization code

Ten bucks is nothing to go from insanity to sanity. GoDaddy, Spymac and several other registrars are just too much for me to look at. The simplest tasks are made impossible by horrid control panel design and rude upsell ads. I’ll take my registrations without the LSD, thanks.

Tags: , , ,

Image Upload Problems with WordPress?

Here’s the fix if your WordPress version 2.6 or 2.7 is failing on image uploads with

The uploaded file could not be moved to /var/www/vhosts/

Before you read further, please note A) these instructions are for *nix servers (typically Linux), not Windows servers, so ask your host which you have if you don’t know, B) you’ll need to ssh into your server and run command line commands, and C) I have the very macho root access to my Linux/Apache server, so I can run chown commands. Most hosts will disallow you root access, and you’ll simply have to ask your tech support to do this. That shouldn’t be a problem.

Having said that, you want the ownership and permissions to look like this for these three important directories:

wp-content drwxr-xr-x (755)  user group
uploads drwxr-xr-x (755)  apache apache
themes drwxr-xr-x (755) user group

and PHP safe_mode is OFF

Read the rest of this entry » »»»»» »

Tags: , , , , ,

Subdomain or Subdirectory?

A client asked me if he should put a blog on a subdomain or a subdirectory, in other words or His concern was about the future: he’s heard a subdomain will scale better. Good question, but don’t let it hold up progress because it’s not that important any longer. From an SEO standpoint, conventional wisdom said to make it a subdomain. From a scaling standpoint, conventional wisdom said make it a subdirectory.

Scaling issues are good problems to have, it means you’ve got tons of traffic and are probably making a nice sum, thus able to pay someone to do work for you. Having a scaling problem is like having a boat so big it’s hard to find a marina.

Read the rest of this entry » »»»»» »

Tags: , ,

Bottom Dropping out of Ad Revenue

My various web sites have pretty good traffic, and ad revenue has been a growing slice of my income pie. In the past ~6 weeks the revenue from  Google ad spots has dropped maybe 20%*. And that’s with an increase in impressions on the order of 40%*.

The number of ads shown is going up — I’m adding different spots throughout my sites, with each of those showing more frequently — while the overall revenue is going down.

On the flipside, buying traffic has gotten cheaper. I’ve managed to reduce my average bid while keeping the amount of incoming traffic steady.

* off-the-cuff numbers


My Thoughts on Hosting

How do I know television advertising works? Four out of five new clients now bring me their GoDaddy-bought domain names. It’s an epidemic.

I prefer hosts that don’t make (much/any) money off of domain name registrations, so that we’re all saved from the inane upsells with which GoDaddy pummels their users. Ask anyone who’s logged into an account there.

I sometimes log into clients’ GoDaddy accounts and personally think it’s a disaster, but their tech support is quick. However fast responses to problems don’t make up for it. I steer clients away from GoDaddy when I can.

Read the rest of this entry » »»»»» »

Tags: , ,

Display Much Information in a Small Space

So I’ve got this popular Volvo web site with about 11,000 registered users. Super. The heart of it is the Volvo Forum, a roiling, boiling mass of Volvo owners trading information, advice and tears at the rate of 75-100 posts per day. The problem is that from the Home page, it doesn’t look so roiling-boiling. Fix: show the activity on the Home page. Get it out in front of people.

Ok, not a hard task. The phpBB forum (outstanding, free software by the way) is on interior pages, and is run entirely by the site’s database. All I needed to do was query a table in the database for the ten or 15 or whatever number of latest posts and voila, the roiling-boiling is then shown to the browsing hoi polloi.

But a) I wanted it up near the top to lure users deeper into my site and b) I didn’t want it to take up much space.

Ingredient #1

After scouting around for some possibilities I found Latest Posts, a script that pulls latest posts from a phpBB forum and displays them in a scrolling marquis.

Not bad. So I used it at the bottom of the Home page. Read the rest of this entry » »»»»» »

Tags: , , , , , ,