Drupal - How do I convert a Wordpress theme?
There is no direct way to do it nor any programmatic way. This is because the template structures differ so much. But here are the steps you should take for the fastest conversions...
- Load theme in Wordpress then view site in a browser. (the purpose of this is to extract the basic HTML structure of the template).
- View source on the page, copy all the HTML and drop into a text editor. Save into a new project folder.
- Copy over CSS and JS files to this new project folder. I recommend using a "css" folder and a "js" folder for organization.
- Copy over all images to this project folder. I recommend using "images" folder.
- Now you have the base template you need to turn it into a theme for Drupal. Time to get busy!
- I recommend copying the "garland" theme to a new project folder and renaming it to your new theme name. This will speed things up.
- Copy over the css, js, and images folders to the new theme project.
- Edit the .info file to load css and js files.
- Modify the css and js files to load any images and other file paths to be relative to them.
- Using a side-by-side comparison between the page.tpl.php and your template html file you will need to transform the structure of the tpl file to be close to that of the html file. Be careful not to remove dynamic references.
- Test, troubleshoot as needed.
Its a lot of steps, but it works. You can also use a theme framework that provides a skeleton theme to build upon. The only problem with this is that sometimes these frameworks are very heavy handed and do far more than is needed. Zen is a common one, but it is very heavy handed. You can find more on the Drupal website at drupal.org (search for themes). Below are some links to a few base themes.
- Zen Framework
- NineSixty (960 Grid System, very flexible concept, I have never used it though)
- Fluid Grid (another great concept, I have seen this in action and its pretty nice)
Finally, here is a link to Drupal's theming guide.
I agree with pthurmond's answer, but I would suggest not to copy the whole HTML and CSS but to do it step by step. Copy the HTML first for, say, the menu; then copy the CSS for it. Use Firebug for the process. This way you will end up with only the really required things. I also recommend a grid system line 960.gs as it is very flexible and you won't have any layout problems.