logo

WordPress Theme Tags: ‘include’

logo

There are 2 types of include tags. The first type are have set properties. they include:

<?php get_header(); ?> // include header.php
<?php get_footer(); ?> // include footer.php
<?php get_sidebar(); ?> // include sidebar.php
<?php comments_template(); ?> // include comments.php

The second type is more flexible, you can include any file you want. You set the property:

<?php include (TEMPLATEPATH . ‘/header2.php’); ?> //notice the header2.php

there are many ways to use this. In my theme Indian Red I used it to load the 4 boxes at the top. I did this so the users could edit the files easily.

So if you wanted to show a different header section for pages than the rest of the site you could write a condition statement such as:

if (is_page())
{
include (TEMPLATEPATH . ‘/header2.php’);
} else {
get_header();
}

I’ll tell you more about condition statements later.

Related posts:

  1. WordPress Theme Tags: ‘bloginfo’
  2. WordPress Plugin tutorial part 2 The Header
  3. WordPress: 1 Page Diffrent Look
  4. Adding A Guest Blogger Intro Block
  5. Free WordPress Theme:Political Politics

Leave a Reply

CommentLuv Enabled
logo
logo
Powered by Wordpress | Designed by Elegant Themes