Subversion Cheatsheets

Version control is a key part of a successful software project, and we use Subversion heavily at Automattic. All our themes, side projects, and even PSD files go into SVN repositories.

We often talk to theme designers that are getting into more advanced theme development who need a quick crash course on using Subversion. As part our tips for version control we recommend keeping a handy reference guide at your fingertips for common Subversion commands.

Continue reading “Subversion Cheatsheets”

CSS Tip: Hiding Content with Clip

In our themes on WordPress.com we often hide text from screen display but still want it to remain for screen readers. Typical techniques like text-indent and absolute positioning work fine until you try to add RTL support to the theme. After adding RTL styles those techniques cause layout issues; most commonly a huge horizontal scrollbar in certain flavors of IE.

Here’s a technique I came across on Adaptive Themes (Professional Drupal themes and design services) that works really well for this situation.

.element-invisible {
  position: absolute !important;
  clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
  clip: rect(1px, 1px, 1px, 1px);
}

In our testing it seems to work great across all our target browsers.

See the full post on the Adaptive Themes site: Using CSS clip as an Accessible Method of Hiding Content.

Custom Menu Code Samples

Do you find yourself taking older themes and adding support for Custom Menus? Here are code samples that you can use for just that.

To be clear, this isn’t a full-blown tutorial for Custom Menus. See Justin Tadlock’s excellent post, Goodbye, headaches. Hello, menus! or the wp_nav_menu Codex page for all the juicy details.

Continue reading “Custom Menu Code Samples”

Can I Make a ‘Premium’ Theme My Own? And Then Release It?

Can you make a ‘Premium’ Theme your own? And then release it? For free? Or for a fee? The answer is simple. Yes.

That is, if the ‘Premium’ WordPress Theme in question—premium meaning you have to pay for it—is licensed under the GPL. The GPL is the GNU General Public License; a document included with a bunch of different open source projects, like WordPress, that covers the terms of the release and makes sure that it always remains open source. Anyway, what does this mean for ‘Premium’ Themes, you ask.

It means you can take a ‘Premium’ WordPress Theme you bought and do whatever you want with it—except release it again as a ‘closed source’ project. The really cool thing? This gives you the freedom to take that project and improve on it.

Here’s an example. You’re a designer and you love working with Photoshop. But it doesn’t have an instant rainbows-and-unicorns button. Adobe won’t put it in. If Photoshop were an open source project you could take the code and add in the technology to instantly add rainbows and unicorns to every one of your photos—and then give your customized Photoshop [RaU Edition] to anyone who wanted it. Presumably, anyone who loved rainbows and unicorns as much as you.

Same thing with GPL WordPress Themes.

But is it right? Not everyone thinks so. Some people have suggested it’s sleazy (mostly in response to people buying a Theme and immediately turning around to release it for free). What follows is my answer to the question. It’s something I posted earlier on the WordPress Tavern forums and here now where everyone reading ThemeShaper can easily find it.

Ian Stewart’s 4 Ideas About Modifying Premium Themes and Releasing Them

  1. Redistributing unmodified GPL code over the internet is not sleazy. Redistributing unmodified GPL code is what the GPL is all about—even if the author of that code is charging for it and depending on that income.

  2. Redistributing unmodified GPL code over the internet is pointless and stupid. If you’re doing it as a matter of free open source principles, sure, I could see that—but you’re muddying up the web. It doesn’t add any value to the code and unless you plan on keeping up with updates to that code you’re actually doing everyone who sees that redistributed code a huge disservice. Way to go.

  3. I say “everyone who sees that redistributed code” because that will be a small amount of people. A small amount of people who will be rightfully wary of downloading that code. The vast majority of people will choose to download that code from the original author. Anyone want to start downloading WordPress from “www.crazywpdownloadsite.com”? I thought so. Remember that “trust” and “authority” are huge things on the web. People selling GPL WordPress Themes: stop worrying about this.

  4. Now that we know that people redistributing unmodified GPL WordPress Themes over the internet are stupid we need to recognize how awesome it is that people can modify GPL WordPress Themes and redistribute them online. Theme-sellers: this is how you got started selling themes. Every single one of you. Remember when you were nervously trying to lock up the code for your first theme options pages behind a restrictive license? The code that you essentially copy-pasted from the same 2 online tutorials I and countless others did? I’m looking at all of you. Anyway, where would you be if that code wasn’t given to you in the first place? Where would you be if you didn’t fork the Default Theme? Or Sandbox? Or Classic Theme? Where would you be if Matt didn’t fork b2? Don’t worry about people forking your code. The freedom to redistribute modified code is incredibly awesome and, no exaggeration, is quite literally making the world a better place.

What Now?

You can find a whole whack of people releasing their Premium Themes under the GPL License on the official WordPress Commercial Themes Directory. You can find all my commercial Child Themes for Thematic in the ThemeShaper Thematic Theme Store.

Anyone ready to start making WordPress Themes awesome-er?

So You Want To Create WordPress Themes, Huh?

Update: It’s live! It’s happening! Go read How To Create a WordPress Theme and learn how to code up something awesome.


Does that title sound familiar? Over 2 years ago the now defunct WPDesigner.com published a series of posts under that banner, teaching beginners how to create WordPress Themes from scratch.

2 years ago is a long time online: Things have changed.

Starting next week, ThemeShaper will publish a series of daily lessons that will teach you how to create your very own modern WordPress Theme—from scratch—using the latest best practices.

And it won’t be just any old WordPress theme you’ll have in your hands. In a lot of ways it will surpass what’s been done with the popular Thematic Theme Framework. Except, it’ll be a little leaner, a little meaner, and it’ll be all yours.

Here’s the laundry list of features your finished theme will be able to boast of.

  • Search-engine optimization
  • Microformats
  • Localization support for translation
  • Robust dynamic body and post classes
  • Separated Comments and Trackbacks
  • Gravatar support
  • A valid, logical, semantic XHTML structure you can use to build ANY layout
  • Valid CSS
  • A strong typographical foundation
  • Smart default layouts (that we can adapt for later layout generation)
  • 2 widget areas, with NO hard-coded widgets, that “disappear” from the markup when they’re empty.
  • Styling for WordPress Image Classes
  • And pretty much all the typical WordPress stuff

When you’re done you’ll have a complete—and completely powerful—WordPress Theme that you can edit further or build on with a WordPress Child Theme. The choice is yours.

Are you ready?

WordPress as a CMS: How To Think About Building a Website With WordPress

Plan your WordPress site design

Figure out what sort of pages we’ll need

Before a visual design can begin, you need to do content design. Determine what exactly you’re going to say. Words, sentences and paragraphs are the building blocks of your site’s foundation. Make sure you’ve put them together correctly. And make sure you know what you need that foundation to do. I mean, think about how those words, sentences and paragraphs are going to effect your bottom line. Remember, we’re making this site for a reason. Whether it’s to get a laugh or make a buck, all those words, sentences and paragraphs need a reason for being there. They mean something.

Anyway, you’ve done all that right? We need to think about how we’re going to present that content. To put things really simply, once you know what you’re going to say with your content and what you want it to do site design comes down to designing series of page templates. That’s it really. As a practical matter, site design becomes a series of templates. Continue reading “WordPress as a CMS: How To Think About Building a Website With WordPress”

The Ethics of WordPress Themes at a Premium

Are WordPress Themes open source? Is it right to release them on a pay-to-download basis?

… what these premium theme providers are doing … we would call that “Evil”Chase Sagum

… themes link and use lots of internal WordPress functions, which make them linked under the GPL and subject to being a GPL-compatible license. If a theme (or a plugin) used no internal WP functions or APIs, then it could probably be considered independent, but that would be really really hard for a theme. Matt Mullenweg

I haven’t really talked about it a lot but I’ve been trying to do pay-for-use themes differently. Namely, giving away what might normally be considered a “Premium” theme—my WordPress theme framework Thematic—and charging for upgrades in the form of Child Themes and custom design. I think it’s a little more fair to the WordPress community and the debatable concerns around the ethics of paid WordPress themes.

But there’s still more questions. There’s always questions, isn’t there? Continue reading “The Ethics of WordPress Themes at a Premium”

Any WordPress Theme Can Be a Blank Framework

A question from a reader has prompted this post. What makes a WordPress Theme Framework? I say, any WordPress theme can be a theme framework.

I’m researching Thematic and would really like some clarification on child themes. You say several places to use a child theme but I couldn’t find a list — is Junction the only one? I’m very interested in your comment that “if you’re starting with a Child Theme any WordPress theme becomes a blank framework”. But how? Could you explain a bit? Maybe a step-by-step explanation? Do you install Thematic, then the child theme, then how does “any WordPress theme” come into play? Valerie

So is it true? Yep. I’ll tell you how, why and what it means. Continue reading “Any WordPress Theme Can Be a Blank Framework”

How I used a WordPress Child Theme To Redesign My Blog

Problem: You want to take advantage of WordPress Parent-Child Themes but you want more control than is usually afforded through CSS alone. What about adding a Favicon? Or a link to a custom stylesheet for IE fixes.? Or editing the menu? How do you do that without messing around with the original Parent Theme?

Solution: You do what I did. I had this exact same problem redesigning ThemeShaper to take advantage of my WordPress Theme Framework, Thematic. I’ll tell you how I solved it and give you a better idea of the power of the functions.php file in WordPress Child Themes.

When you’re done reading this post you should be well on your way to taking full advantage of the power of WordPress Child Themes and redesigning your blog the smart way—leaving the original parent theme files untouched.

And if you haven’t heard about WordPress Child Themes before, make sure you take a look at my post on How To Protect Your WordPress Theme Against Upgrades. I go through a quick primer on them and how to get started using them (along with some useful tips on using Plugins).

First, Make a Functions.php File

Currently, only two overriding files are recognized in WordPress Child Themes, style.css and functions.php (unless my proposal for 2.7 makes it in). You can do a lot with CSS alone but with functions.php your theme can interact with WordPress just like a plugin.

First things first: make a file in your Child Theme folder called functions.php and add the PHP opening and closing tags to the first and second line (<?php and ?>) using your favorite text editor (I use Smultron). Make sure you don’t have any extra lines before or after these tags. We’re going to be inserting the following snippets of code on the lines in-between these tags. Now you’re ready to make your WordPress Child Theme sing.

… not literally, of course. That would be annoying. Continue reading “How I used a WordPress Child Theme To Redesign My Blog”

A Revolution in Theming: WordPress Theme Frameworks

WordPress is exceptionally easy to Theme—but it can be better. WordPress can be a smart little CMS for most websites—but it can be better. How? WordPress Theme Frameworks.

A while ago I asked a whole bunch of smart people what they thought the future of WordPress themes would look like. I also asked the whole WordPress community (also very smart) to think about a new default theme for WordPress. It’s putting those two things together that’s led me to the following statement:

The future of WordPress theming is in Theme Frameworks. If WordPress included three or four theme frameworks—not default themes—in the core it wouldn’t just be the easiest CMS to theme, it’d be the smartest.

Thinking of Theme Frameworks as something different from Themes could be revolutionary. And they don’t have to be included in the WordPress core to change how we think of WordPress themes. But take a look at my proposal for powering-up Child Themes in WordPress 2.7 and some of the current benefits of using them. And while you’re at it, check out Thematic.

Thematic is my own personal WordPress theme framework that I’ve released to take advantage of all this. Sort of an über-theme that puts the best of everything in one place so the core of it will never have to be messed with. It really leverages what you can do with WordPress themes: everything that needs to be changed is either an option (even the footer credits!) or a widget, leaving customization to the CSS in a Child Theme.

And that’s Customization that’s easy to make—for developers and enthusiasts—since the Thematic CSS is modular. The Reset, base Typography and Plugin styles have been separated from the basic look and ready to be used independently by Child Themes.

What do you think about WordPress theme frameworks? Sound Exciting? I think so.

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 “How To Protect Your WordPress Theme Against Upgrades”