YAML based WordPress Theme
June 9th, 2008
Now If you hadn’t heard of YAML yet then it is time now. YAML, abbreviation of Yet Another Multi-Layout, is a CSS framework.
“A CSS framework is a library that is meant to allow for easier, more standards-compliant styling of a webpage using the Cascading Style Sheets language. Just like programming and scripting language libraries, CSS frameworks package a number of ready-made options for designing and outlaying a webpage.” –wikipedia
The reason why I chose YAML to develop my wordpress theme is because of the following features.
- Navigation Bar
- Sliding Door type

- Shiny Button type

- Sliding Door type
- Vertical List Navigation

- Ready to use 2-column, and 3-columns layouts
- Ready to use print CSS for 2-column and 3-column layouts
- Ready to use typography CSS
- Browser consistency etc.
Well that’s where the good part ends. I found out the hard way that WordPress is not friendly with CSS frameworks.
Why WordPress is unfriendly with CSS frameworks?
The major hurdle is getting various lists from WordPress like pages, categories, archives etc. WordPress provides methods like wp_list_pages, wp_list_categories to fetch these details but WordPress provides this in a format that cannot be used with frameworks (not only YAML but any CSS framework).
I won’t go into details why this is such a problem but you can solve this problem in two ways.
The first technique is writing a method which transforms the output format of WordPress methods to your desired format with some string manipulation. Personally I don’t recommend this method because it is inefficient as in the string manipulation has to be performed every time the page is loaded which is only a waste of CPU cycles.
The second method is hacking the methods wp_list_pages, wp_list_categories etc such that we get the output in the desired format we want. Since we aren’t doing any unnecessary string manipulation here this is much more efficient.
Conclusion
Yes, YAML based WordPress theme can be built but you need to do a lot of hacking. If you don’t want to do any hacking then you won’t be able to use all the YAML features like sliding door navigation bar or vertical list navigation etc.