Code

Minimalist WordPress Theme Development

When I began to explore the WordPress theme code at my beginnings with WordPress, I came across a problem that I could solve only after a while. At that time I had no idea of minimalist web design, yet I wanted to stick to a minimalist web development habit, i.e. code less and have less files. While coding less can be grasped immediately as a saver of time, bugs and nerves, minimalist design is harder to understand in nature as it has to do more with arts. Even though now I am able to color some pixels on the screen about minimalist web design, it is not what I intend to discuss here. I want to share with you what I kept for a invention at the time my PHP grasp was very immature.

It was the case when I wanted to have most WordPress template files reduced in one as the case of the classic WordPress theme. In other words, I wanted to use only the index.php file which would do the role of home.php, singe.php, page.php etc. But I wanted to have a default excerpt option for all of them except singe.php and page.php. This made me have an hard coding time, but the pleasure of solving it was great. My “invention” is below:

<?php if ( is_single() || is_page()  ) {
    the_content();
} else {
    the_excerpt();
} ?>

That’s it. I just wanted to share this with you and why not be a little helpful. I would love your feedback. Please, drop me a line. Thanks!

Baki Goxhaj
I’m a web consultant specializing in WordPress. I love elegant solutions, quality code and a good laughter.
You may also like
I’m Sad to See WordPress Themes Using Tables
That’s Awksome!
3 Comments
  • […] portfolioWordPress Freelancer » Blog Design: TroyBroussardTravel.com on PortfolioBANAGO on Minimalist WordPress Theme DevelopmentBANAGO on Blog Design: TroyBroussardTravel.comSajid Iqbal on Blog Design: TroyBroussardTravel.com […]

  • BANAGO Dec 21,2008 at 12:12 pm

    Thanks Joan, I really appreciate your commenting.

  • Tips Beauty Nov 29,2008 at 11:44 pm

    I ve been reading along for a while now. I just wanted to drop you a comment to say keep up the good work.

    Joan

Leave Your Comment

Your Comment*

Your Name*
Your Webpage