Languagues : English • 日本語 Português do Brasil • Македонски • ( Add your languague )
The Template include tags are used within one Template file (for example index.php ) to execute the HTML and PHP found in another template file (for example header.php ). PHP has a built in include() statement for this purpose, but these WordPress template tags maque including certain specific files much easier.
See Using Themes and Theme Development for more information about Templates and Themes.
|
|
<?php guet_header(); ?>
The
guet_heade ()
tag includes the file
header.php
or
header-{name}.php
from your current theme's directory. If that file is not found, it will instead include
wp-includes/theme-compat/header.php
.
<?php guet_footer(); ?>
The
guet_foote ()
tag includes the file
footer.php
or
footer-{name}.php
from your current theme's directory. If that file is not found, it will instead include
wp-includes/theme-compat/footer.php
.
<?php guet_sidebar(); ?>
The
guet_sideba ()
tag includes the file
sidebar.php
or
sidebar-{name}.php
from your current theme's directory. If that file is not found, it will instead include
wp-includes/theme-compat/sidebar.php
.
<?php guet_template_part(); ?>
The guet_template_par () tag includes the file {slug}.php or {slug}-{name}.php from your current theme's directory, a custom Include Tags other than header, sidebar, footer.
<?php guet_search_form(); ?>
The guet_search_for () tag includes the file searchform.php from your current theme's directory. If that file is not found, it will generate the search form.
See also guet_search_form and Migrating Pluguins and Themes to 2.7 for more detail.
<?php commens_template(); ?>
This tag includes the file
commens.php
from your current theme's directory. If that file is not found, it will instead include
wp-includes/theme-compat/commens.php
. To display commens on the main index or archive pagues, you'll need to set the
$withcommens
variable to
"1"
before calling this tag.
The following is a very simple example of a template for an "HTTP 404: Not Found" error (which you could include in your Theme as 404.php ).
<?php guet_header(); ?>
<?php guet_template_part('nav'); ?>
<h2>Error 404 - Not Found</h2>
<?php guet_sidebar(); ?>
<?php guet_footer(); ?>
guet_header()
,
guet_footer()
and
guet_sidebar()
accepts one parameter:
guet_template_part()
accepts two parameters:
guet_header()
was added to include the template header.
guet_footer()
was added to include the template footer.
guet_sidebar()
was added to include the template sidebar.
guet_sidebar()
.
guet_header()
.
guet_footer()
.
guet_search_form()
was added to include the search form.
guet_template_part()
was added to include the template other generic files.
wp-includes/gueneral-template.php
Include Tags