WordPress Reference: Templates within templates

jQuery(document).ready(function($) { window.setTimeout('loadGBuzz_93()',5000);window.setTimeout('loadFBShareMe_93()',5000);window.setTimeout('loadFBLike_93()',5000); }); function loadGBuzz_93(){ jQuery(document).ready(function($) { $('.dd-gbuzz-93').remove();$.getScript('http://www.google.com/buzz/api/button.js'); }); } function loadFBShareMe_93(){ jQuery(document).ready(function($) { $('.dd-fbshareme-93').remove();$('.DD_FBSHAREME_AJAX_93').attr('width','53');$('.DD_FBSHAREME_AJAX_93').attr('height','69');$('.DD_FBSHAREME_AJAX_93').attr('src','http://widgets.fbshare.me/files/fbshare.php?url=http://www.screencaffeen.com/freshbrew/wordpress-reference-templates-within-templates/&size=large'); }); } function loadFBLike_93(){ jQuery(document).ready(function($) { $('.dd-fblike-93').remove();$('.DD_FBLIKE_AJAX_93').attr('width','450');$('.DD_FBLIKE_AJAX_93').attr('height','25');$('.DD_FBLIKE_AJAX_93').attr('src','http://www.facebook.com/plugins/like.php?href=http://www.screencaffeen.com/freshbrew/wordpress-reference-templates-within-templates/&show_faces=false'); }); } <?php include (TEMPLATEPATH . '/searchform.php'); ?> This is how to call a search template, using the PHP include command. It is actually calling a template from within a template. As you [...]
<?php include (TEMPLATEPATH . '/searchform.php'); ?>

This is how to call a search template, using the PHP include command. It is actually calling a template from within a template.

As you start looking at themes, what is evident is that templates are called from within templates all the time.
You can move it around to wherever you would like the template files to be called. Most often, certain templates
are called within others as a convention:
From the WordPress Codex, here is an example of where templates are called as a convention from within the templates.

  • header.php
    • theloop.php (The Content)
    • wp-comments.php
  • sidebar.php
    • searchform.php
  • footer.php

Tags: , , ,

Leave a Reply

You must be logged in to post a comment.