P. 1
Smashing Wordpress

Smashing Wordpress

|Views: 750|Likes:
Published by Maria Vasii

More info:

Published by: Maria Vasii on Jun 26, 2011
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less





Child themes can certainly spin things around. Say that you love a particular theme, and it has a
class called column-right, which is used to place the ever-present sidebar to the right side of
the main content, in a suitable column. Fair enough. Problem is, you want it on the lef side, which
you can easily fx by just applying fl oat:left in the style.css fle of your child theme, possibly
altering some other stuf as well, but you get the idea.

It works, but it is ugly to have an element named column-right positioned to the lef.

Tis may seem a bit nerdy, even trivial, but writing code that makes sense is important when
several people are collaborating on a project, and also good form in general. While you may not
care much about the latter (which sometimes is more than warranted), the former can prove to be a
real issue for the best of us. Te whole point of naming elements in design afer what they actually
are supposed to be is that you, and the people you work with, will have an easier time fnding your
bearings in the design.

So column-right should really be on the right side. Tat’s where you’ll look for it, thanks to the

Another popular example of this is the sidebar. A lot of people think that the sidebar.php tem-
plate, or at least the actual term “sidebar” should be retired. It is something of a relic from the
past, from the time when WordPress was about blogging only. Today it is a CMS, and you use
it for a lot more than just publishing blog posts. Why call it sidebar, why not sidecolumn? You
can take the reasoning another step; what says that it will be on the side of things at all? Single
column designs ofen position the sidebar.php content at full width below the main content,
above the footer. Tere’s nothing wrong with that, other than that the sidebar obviously isn’t to
the side.

Now, perhaps that’s taking it a bit too far. WordPress will probably keep using the sidebar lingo for
quite some time, but that doesn’t mean that you need to name things column-right. It is some-
thing to think about when designing themes, because while a certain name may make a lot of sense
in the present context, there’s nothing to say that you won’t be moving that column-right to the
lef side. And if someone were to take your theme as a mother template theme for a child theme,
that is even more likely to happen.

So think about the semantics. It’ll make things easier on everyone.

E1C05.indd 108
E1C05.indd 108

12/23/09 3:53:57 PM
12/23/09 3:53:57 PM

Chapter 5: The Child Theme Concept


Also, if you’re one of those people that think that this is a load of nonsense, or if you’re on the other
side of the fence, being very vocal about correct semantics, feel free to pick the Notes Blog Core
theme to pieces. Personally, I think it is a fairly usable compromise, but it could be better in both
ways. It just proves that these are hard things to agree upon.

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->