WordPress template wrapper
One of things I wanted to do for a long time and that leads to immediate return is streamlining WordPress coding.
This is just an aside, I have had an impression that WordPress market is apparently achieving a same sort of momentum as Macromedia / Adobe Flash once had. It was only yesterday I saw a short TV program (or TV ad?) on a Portuguese TV station (RTP). The program looked like an introduction to work related skills development course for adults in Portugal. The short ad like TV program was showing WordPress Post editor for a second. It hinted me that we can expect to see more and more people using WordPress in their daily life. It means that the WordPress development market will have more impacts to the society thus more business opportunity. Simply said, if you make WordPress easier for people to use, you can win more chances to become prosperous.
So I wanted to talk about the WordPress template wrapper. I have recently had a chance to look at a theme tailored for publishing documentation online, it is called weDocs. I had a joy of reading the code and file structure of weDocs WordPress theme. It is easy to follow logic and customize. What caught my immediate attention is how the author approached to layout the template. The definition of layout hereby is exactly this:
Layouts are used for “wrapping” the content of individual pages with common elements, such as the <head> and footer sections, which usually contain necessities such as <link> and <script> tags.
Code comment indicates that original discussions appeared at Theme Wrappers (Scribu) and Theme Wrapper (Sage).
The theme wrapper class makes internal structure of templates much easier. For example, in page.php you only need one or two lines of get_template_part(). In the base.php (or wrap.php depending on how you like to call it), you fill in the layout. Then you can remove a lot of code redundancies. (say, you do not need to copy and pasting the same layout into each one of page template php files, which leads to more likelihood of making mistakes.)
There may be some glitches in using third party plugins. I still need to study the code and make my own class so that I do not have to struggle with maintaining redundant template codes any more. The WordPress Theme Wrapper was a revelation of the day.
Production environment and creative drive
I remember that I used to have so much fun a long time ago when I was using an old Mac to write about anything. I think that it does not really mean that I can regain the drive back now if I use Apple Mac LCIII. Or Mac Plus which I used to have wanted. Sometimes I miss old environment or tools I let it go, which I will not be likely to get back. Maybe it is not something physical which animated my creative drive, passion or inspirations.
If you happen to have anything that makes you comfortable or happy, it is better to keep them because it is often difficult to find them again. It is a miraculous encounter. Of course as long as you are not too blind to be able to tell junks from real treasures.
The post Morning pages: wordpress template wrapper, production environment etc. appeared first on Befive.Info.