How To Convert An XHTML Website Template Into A WordPress Theme
How To Convert An XHTML Website Template Into A WordPress Theme
Pages Menu
Jon Bishop
WordPress, Social Media and Web Development
Categories Menu
Home
How To
Posted by Jon Bishop on Mar 16, 2010 in How To, Themes, Web Development, WordPress | 38 comments
WordPress Theme
So you have an XHTML valid website template and you would like to put it on top of WordPress. Whether you are starting from scratch or moving your existing
9
Suka
website to WordPress as a CMS, this guide will help you get the conversion done. Keep in mind that these are the basics and this is not a guide on how to develop themes for public release.
Email Print
Getting Started
First, lets set up our theme files.
/* Theme Name: Rose Theme URI: the-themes-homepage Description: a-brief-description Author: your-name Author URI: your-URI Template: use-this-to-define-a-parentthemeoptional Version: a-numberoptional . General comments/License Statement if any. . */ CSS Goes here
display different bits of information from the WordPress database. These are the main tags needed to make your WordPress theme work.
Stylesheet (video)
We are going to need to swap out the call to our stylesheet with:
to your header (Usually write above the closing </head> tag). Then you should add:
The easiest way to do this is to do a search and replace for src= and add theappropriatetemplate tags. This is not fool proof as not all template structures are created equal but it will work a majority of the time.
End:
http://www.jonbishop.com/2010/03/convert-html-wordpress/[4/28/2013 9:09:15 AM]
The Permalink
The Content
Example Code
So this becomes this.
Navigation (video)
http://www.jonbishop.com/2010/03/convert-html-wordpress/[4/28/2013 9:09:15 AM]
Most themes will have the navigation within an unordered list. This makes things easy for you. All you need to do is replace the list elements (everything between the <ul></ul> tags) with the following:
This is the most basic of menus and wont display child pages. You canexcludepages by simply adding the page idsseparatedby comas after exclude=. Learn more about wp_list_pages().
Feel free to contact me if you would like to learn how to bring your theme to the next level with a sidebar, comments and other interactive elements.
More Resources
Theme Development Stepping Into Templates WordPress Theme generator
Leave a comment below and continue the conversation, or 739 Save subscribe to my RSS feed to get articles like this delivered automatically to your feed reader.
saves
37