How To Protect Your WordPress Theme Against Upgrades

Problem: You’ve finally found a theme you like but you want to modify it. The modifications are pretty simple but what happens when you want to upgrade the theme? Do you really want to go through all those files again hunting down the changes? Don’t you wish you could just upgrade and be done with it?

I’ve been there. I’ve done everything the wrong way at least twice. Learn from my mistakes. Here’s the right way to modify your theme and protect it against any future upgrades. And don’t worry, it’s really simple. As it usually turns out, WordPress is ready for us and has done most of the heavy lifting.

Continue reading

Hide all your links

Want to concentrate solely on typography and foundational structure while you’re designing your next WordPress theme? Hide all your links. Make them black. Get rid of the underline and make them blend in. Destroy all visual evidence of hypertextuality. Show no mercy as you attack the lists and paragraphs and headings that shore up your content and don’t let anything distract you from your end goal: typographic excellence.

Assuming you’re starting with a white background and black text, CSS makes it relatively easy to exterminate anchors with extreme prejudice:

a {
color:#000;</code><code> text-decoration:none;
}

There. Now go make something beautiful.

While you’re at it, try hiding your header and sidebar in The Ultimate WordPress Theme Test.

Thematic Version 0.3

Thematic version 0.3 is ready. If you’re upgrading, stuff moved. That’s beta for you—but don’t worry, I’ve made things better. Here’s what I’ve gone and done.

  • Added a 3 column stylesheet
  • Cleaned up the post meta and separated it from the comments section following popular convention (and probably breaking stylesheets)
  • Prettified the sliding meta panel with a photoshop-y G.I. Joe handle (it’s like Snake Eyes designed it!)
  • Added an option to control the position of the widget area that shows up between the post on the index page—a great place for promoting something important
  • Added a print stylesheet that should undo any unprintable styles you add to your theme.

Continue reading

How To Add Gravatars For The Post Author in WordPress

Now that Gravatar support is part of the WordPress core adding them into your WordPress theme is easy. Adding them to your comments has been documented. How about adding them to your post titles to highlight the comment author? Within the loop? That’s fairly easy too. Here’s the code:

<?php echo get_avatar( get_the_author_email(), '80' ); ?>

Pretty simple, huh? get_the_author_email outputs the post author’s email and the “80” is the size of the avatar image in pixels (you can change that). How this will look depends on how you use it; where you put it in the theme (it has to be in the loop!) and how you style it.

Continue reading

How To Build WP-PageNavi Into Your WordPress Theme

WP-PageNavi, from Lester “GaMerZ” Chan, gives you an awesome upgrade to your WordPress post-page navigation. Instead of the typical “Older Post/Newer Post” links, you get “Digg-like” pagination. Like so:

Wp-PageNavi Sample

Very cool. But what if you want to incorporate it into a WordPress theme for release? How do you style it when the instructions tell you to modify the plugin files? Good questions. I’ll tell you how. Continue reading

We Need To Kill The Sidebar

It’s time for the WordPress sidebar to go, and all mention of it to be wiped out from existence. I’m not talking about the visual idea of a sidebar on your blog. No. I’m talking about the WordPress function get_sidebar() and the use of the term, Sidebar in the WordPress admin. This way of thinking is obscuring the vision of WordPress designers and limiting the potential of your blog theme.

Here’s why: A sidebar doesn’t have to be a sidebar. Continue reading

A WordPress Theme Structure with Meaning and Possibility

Continuing work on my next theme, Thematic, one thing I want to get out of the way immediately is the structure, or skeleton, of the thing. The outer structure of any HTML+CSS document is where things usually go bonkers and the last thing I want is for my markup to make things worse when I update versions. So, that said, here’s the basic divisions of markup, which I’ll follow with some of my thinking. I’m hoping we can start a conversation over this—and I’m totally up for a raging debate over my non-transcendent approach to this—so give this post a quick scan and see if you can add your two cents. The more the merrier. Continue reading

Coming Soon: My Personal WordPress Theme Starting Point

I will soon be releasing the hacked-up version of The Sandbox that I’ve been using as a starting point to develop free and custom themes. For free. On Google Code. As an open source project. Since I have different goals than the Sandbox creators (and not as much skill!) I won’t call my changes improvements but they are changes you may appreciate:

  • Search Engine Optimization
  • A grid-based starting point
  • CSS Reset and Typography based on Blueprint
  • Markup allowing even more CSS madness than The Sandbox
  • Theme Options
  • More Page Templates
  • More widgetized areas
  • More Microformats
  • Popular Plugin Integration

Continue reading

A Proposal for Theme Management in WordPress

The handling of plugins in WordPress 2.5 is perfect. It’s superb. It’s easy. It’s cake. But now that I have cake, you know, I want to eat it too. I’ve got a proposal for how upgrading of themes should be handled in WordPress 2.6 (or whenever) using a .org theme repository. Maybe more like a couple of ideas. But watch out! My first item is going to be somewhat controversial amongst theme authors.

Use WordPress Theme Options to Store Footer Text

What prevents people from upgrading their WordPress theme? Changes they’ve made to the theme file. Ignoring changes made to accommodate plugins, there’s really only one spot a theme user would really want to change and have no apparent control over in the admin area: the text in the footer. Theme authors should hand over that power.

Continue reading

A Better Spot for The WordPress Meta

One of the first things many new blog owners do is remove the Meta section from their sidebars. Great idea. The Meta information is almost completely useless. And I’m not the only one that thinks so.

The Meta section includes some admin links like “Login” or “XHTML Valid.” While those links might be useful for the owner of the blog, they offer no value at all for the reader. The next time you set a WordPress blog up, start by removing the Meta section from the sidebar. Daily Blog Tips

But you know what? It’s only almost completely useless. It has two great functions; it gives you a link to your admin area from every page and it lets you logout from your blog. Pretty handy when you’re on a public computer. How can we fix this up so we don’t look amateurish and still retain the useful functionality? Easy! Conditional tags and Javascript.

Well, kinda easy. If you want to implement this on your blog you’ll have to do some fiddling around with your theme. No guarantees that the following technique won’t make your site explode.

Here’s what we want to do. Only show the login block to logged-in users and while we’re at it take the whole thing out of the sidebar and put it somewhere really useful: in a sliding panel that drops down from the top of the page with a click, wherever you are on the page.

Continue reading