Whenever you developing the new theme. You need to add following code in your theme file.

wp_head

Goes in the HTML <head> element of a theme; header.php template. Example plugin use: add javascript code.

Usage: <?php do_action('wp_head'); ?>

-or- <?php wp_head(); ?>

wp_footer

Goes in the “footer” of a theme; footer.php template. Example plugin use: insert PHP code that needs to run after everything else, at the bottom of the footer.

Usage: <?php do_action('wp_footer'); ?>

-or- <?php wp_footer(); ?>

wp_meta

Typically goes in the <li>Meta</li> section of a theme’s menu or sidebar; sidebar.php template. Example plugin use: include a rotating advertisement or a tag cloud.

Usage: <?php do_action('wp_meta'); ?>

-or- <?php wp_meta(); ?>

comment_form

Goes in comments.php and comments-popup.php, directly before the comment form’s closing tag (</form>). Example plugin use: display a comment preview.

Usage: <?php do_action('comment_form', $post->ID); ?>

Note: don’t forget to add wp_head, wp-footer and wp_meta methods in you theme.

Using following code you can able to set different layout for each category.

Just create the category.php file or already existed then open that file and use following code in that file.

<?php

if (is_category(10)) {

// looking for category 10 posts

include(TEMPLATEPATH . ‘/layout2.php’);

// or you can use “get_cat_id(’category_name’)” instead of category id

} else {

// put this on every other category post

include(TEMPLATEPATH . ‘/layout1.php’);

}

?>

Here we are calling the layout 2 for category 10.

Have fun!

Related Posts with Thumbnails
Wordpressapi is developer code book.
wordpressapi on Facebook

Who am I?

Sony Kumari founded Wordpressapi in Feb 2010. She started writing since Aug 2006 in wordpress blog. Later on She moved her blog to wordpressapi.com.

Sony Kumari is dubble gradute and earned M.C.A. in Computers. Sony Kumari handled the so many projects in many different technology. She worked on Java, PHP, Ruby on Rails, Javascript, Web services, Social applications, Ad campaigns.

Mahesh is the Author of Wordpressapi, as well as a serial web entrepreneur, sci-fi author, and aspiring world changer. He has been writing for Wordpressapi since Dec 2009. His previous experience includes Photoshop Design, CSS design, Web design and wordpress themes development.

Mahesh is a graduate and earned a B.E. in Electronics. He is having three years of experience in Web design and Wordpress application development.

Rahul is the Author of Wordpressapi, as well as a web designer and photoshop artist. His previous experience includes Photoshop Design, CSS design, Web design and wordpress themes development.

Rahul is a graduate and earned a B.A. in History. He is having Five years of experience in Web design and Wordpress application development.

© 2010 Wordpressapi. All Rights Reserved. Reproduction without explicit permission is prohibited.