feed me feed me chillireward

Article (in detail)

Organizing your theme folder

 

Hello, its wednesday again.. Happy Halloween.! Today, I shall be giving out a tip on how to organize your theme folder, in wordpress so as to get a grip on what you are doing. This is not so much wordpress, as more of a best practice..

Don’t insert your entire code into your sidebar.php, header.php, home.php, page.php, single.php pages… Instead work with chunks.. What do I mean? I shall demonstrate by example.. If you look into my header.php file in my theme folder for chilligavva.com, here’s what you can see after the <body> tag..

This is a slimmer method, and allows me to see what I am doing.. The slicing does not affect the page generation, but is more of a behind the scenes way of allowing you to break down your theme into manageable chunks.. For instance, the baby blocks i am working with is “inc_geoscript.php” and “inc_aboutblog.php”. Note the way I included the file(s). Its preceded by a TEMPLATEPATH location. This way, you can manage any theme or reuse theme iles without typing out oh so long web addresses.. Neat huh?

Hope this was of some use to you…
Grab the sample here…

<body id="top">
<div class="outerwrap"><div class="ctr">     
<a href="#rsslist" class="rss"></a>
     <?php include (TEMPLATEPATH.‘/inc_searchform.php’); ?>
     <div class="logo"><h1><a href="<?php echo get_settings(‘home’); ?>">Chilligavva</a></h1></div>
     <div class="hdr ">
          <? include (TEMPLATEPATH.‘/inc_heading.php’); ?>
          <? if (is_home()){?><div class="whereufrom"><?php include (TEMPLATEPATH.‘/inc_geoupscript.php’); ?></div><?}?>
          <!– end header –></div>
          <div class="clear"> </div>
     <? include (TEMPLATEPATH.‘/inc_menu.php’); ?>     
     <div class="clear"> </div>

     <!– begin content –>
<noscript><p class="noscript">OOPS!  Some parts of Chilligavva <em>will not work without JavaScript enabled</em>.Please, <em>enable JavaScript in your browser</em> and reload the page.  <em>It will not harm your system. That’s a promise.</em></p></noscript>
     <? if (is_home()){ ?>    <? include (TEMPLATEPATH.‘/inc_aboutblog.php’); ?>     <? }?>
 

Page copy protected against web site content infringement by Copyscape

Liked this article? Subscribe to the article feed via feedburner. Dont want to be hassled by feeds, you can Subscribe by E-mail. Want to know who said what? Get my comments feed. Dont know what a RSS feed is? Read about RSS feeds.

Other Posts for you to Enjoy

Feedback Please!

Note: Your comments may take time to appear, as they are moderated for the first time..

All comments are followed.

 
 
Security Image