How to add custom template tag in wordpress theme?

I am working on a WordPress site, it’s an online newspaper site.

The theme I am developing, I want to add custom template functions like get_footer() or get_header(), so that I can save those HTML and PHP codes like the way footer.php stores.

Read More

Thanks in advance.

Related posts

Leave a Reply

2 comments

  1. In WordPress 3.0 you can use

    get_template_part($slug, $name);
    

    This function will include file named “{slug}-{name}.php”. The $name is optional, and if it’s empty, the function will include file named “{slug}.php”.

    There is also the traditional PHP-code, but this do not check if the file exsist.

    include(TEMPLATEPATH . 'template-name.php');