17
2011
WordPress Div Structure Standards
WordPress follows a pretty straight forward HTML structure that can be easily broken down into a usable diagram. With this diagram any web developer or graphic designer that is involved with slicing a photoshop wordpress theme, Illustrator wordpress theme or cascading stylesheet theme can build a universal structure. Any block element such as header or main can have the inner DIV containers swapped quite easily while retaining a solid structure.
WordPress DIV Structure Advantage
This WordPress DIV structure diagram uses the three most common layouts: 1-column, 2-column, and 3-column. By using the basic Header -> Main -> Footer approach we can easily swap any layout into those three containors. We can, for example, build a home page using a full width, 1-colum layout but use the 2-column header. What about putting navigation on the left side running vertically? We can use the WordPress DIV structure standards to do that with ease:
- Lets use the 3-column header and use the middle box for ad space
- We’ll remove the NAV containor because we won’t be using it.
- Using the 2-column layout we can replace the second column name with NAV instead of Sidebar
- Add the footer
That’s it. The easiest way to think about using the WordPress DIV structure diagram is pretend you have a pile of paper all cut up into the boxes and containors in the diagram. So long as we use the same Frame Header -> Main -> Footer we can place those cut pieces of paper in any order and shape we choose to create our website layout. A WordPress theme with dozens of unique layouts using a standard.
A DIV Structure Standard by Name
The WordPress DIV structure standard displayed here is more then just a puzzle with infinite design potential. It creates a very important standard in web development – Naming Conventions . By using the structure with the designated HTML Div naming conventions we bridge a often overlooked gap between the designer and the programmer. The designer won’t ever need slice the theme into a working wordpress theme. A simple XHTML CSS theme is all that is needed. The programmer can take that and add in the neccessary code to make it work within wordpress with relative ease.
By using this diagram the designer and programmer can work in tandem with each other. A programmer can begin programming all the WordPress functions because they will have the fundamental wireframe used from the WordPress DIV structure standard. The designer can create the theme in Photoshop or whatever tool they prefer, slice it to XHTML and send it to the programmer. By doing this the delay caused while the programmer waits for a complete design is eliminated.
The Designer
- Designs the theme
- Gets approval from client
- Slices design into XHTML using the DIV structure with naming convention standards
- Sends it to the Programmer/Developer
The Programmer
- Creates the theme frame from the wireframe – based on the DIV standards
- Adds custom and built-in WordPress functions
- Splits the XHTML Design recieved into Header -> Main -> Footer
- Places WordPress code into the template
- Tests the template
Both the programmer and designer know that the header has a clickable logo, banner ad, and a search bar within the header. They both know that the ID or Class name in the css is going to be logo, header_more, and header_right. They can both use .post{} within the CSS to define how wide the post containor will be. They use the same naming standards and, thus, are on the same page.
This is the basic WordPress DIV structure standard and custom classes and containors will be added for additional features such as Banner Sliders, related posts, sidebar navigation boxes, and much more, but the important outline and framework of the design is established universally between the designer and programmer.
Design Standards Are Future Proof
The other, less thought about, advantage to building a set of standards is when looking to the future. With a design standard any programmer or designer can quickly go into the WordPress theme months down the road and quickly, and efficiently make adjustments to any element without have to search endlessly. How often do we find ourselves going back to a website that didn’t have a standard set and found, in the CSS file alone:
.bg{color:#fff;}
.background{color:#cfc66;}
.conbg{color:#fff;}
.boxbg{color:#fff;}
And lets say the client asked us to change the text color of the sidebar, or post entry to red. Which of those style classes to we use to make that simple change? We will need to waste time testing each one until the results we want are displayed, or use other tools to eliminate the other classes. With a standard set we can simply open the CSS file and change exactly what we need quickly, and without searching:
.sidebar{color:#fff;}
.sidebar h1, h2, h3 {font-size:1.7em;}
.post{color:#ccffad;}
.entry{color:#3c66cc;}
As you can see, using a WordPress DIV structure standard is far easier and more efficient both pre-development and post-development. If the client wanted green headers in the sidebar we know exactly where to find it.
I hope you enjoyed this WordPress DIV Structure Standard article and find ways you can use it to benefit you and your company. I’d like to give a special thank you to Walter Matyas, as this fantastic designer played an integral role in establishing these standards.
Related posts:
7 Comments + Add Comment
Leave a comment
Recent Comments
- Andy on WordPress Upload Attachment
- Rufino on WordPress Upload Attachment
- Neil Davidson on WordPress Upload Attachment
- Rufino on WordPress Upload Attachment
- Neil Davidson on WordPress Upload Attachment

An article by Neil Davidson







Hi Neil.
I think I know where those sketches come from. Hm?
….and have a Happy New Year start up, let your heart follow the best of best,….. that’s beside making tons of money to pay off your mortgage fast.
Walter
Thanks Walter. I made sure to add reference to you as well, for you were a large part of building these standards.
Thanks for this information, I have made my own standard html to start my theme development with, and have for a long time thought this was needed, and wondered why there wasn’t anything like this on wordpress.org.
It’s the fist time I visit your website, but shurely not the last time. Enjoyed the article about wordpress not keeping up.
Thanks again.
Thank you for the kind words. I would love to see what you have done with HTML standards.
Guys, how do you make that header for the Responsive theme?
Sorry for the double post. I mean the 3 column header.
Responsive Design has been around long before it became known as “responsive design”. At least, the core CSS concepts have. The first introduction to responsive design was had by way of fluid layouts – giving a percentage to widths instead of making a column width hard coded (32.2% vs 350px, for example) to allow dynamic resizing of a web page based on screen size.
Now, with @media queries we have three base methods of creating responsive designs, each can include any the others: fluid layouts, @media queries, custom layout per device/screen. There are at least 5 other ways I can toss out as a means of creating a responsive layout, but these three are the most popular and easiest to implement.
To answer your question – from a technical stand point you would use a method of responsive design above to force the columns to re-size and reposition themselves based on screen/device resolution. When designing for a responsive layout many designers don’t take into consideration what a site will look like when each column is stacked on another. This lack of forward thinking is a design flaw, not a flaw in responsive design, for the purpose of this article.
So, that being said, you are left with a decision to make. Of the three header columns what will you place in each one that will work horizontally and be just as aesthetically pleasing placed vertically.