dodanie template file

dodanie pliku template-name.php poprzez kod:

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

load_template(TEMPLATEPATH . '/template-name.php');

locate_template($template_names, $load);

include(get_query_template('template-name'));

get_template_part($slug, $name);

get_stylesheet_directory_uri()/get_template_directory_uri() return a URL
get_stylesheet_directory()/get_template_directory() return a file path
All four of the *get_*_directory_*() functions perform SSL checking
TEMPLATEPATH/STYLESHEETHATH are simple constants, return a file path, and do not perform SSL checking

TEMPLATEPATH // Path to your (parent) themes root dir
STYLESHEETPATH // Path to your parent/child – if present – dir
get_template_directory_uri();
get_template_directory();
get_stylesheet_directory();
get_stylesheet_directory_uri();

// to load a file: path_and_file_name.php which searches in child dir first, then parent themes dir
get_template_part( ‚path_and_file_name’ ); // appends .php automagically
get_template_part( ‚path_and_file_name’, ‚suffix’ ); // loads: path_and_file_name-suffix.php

 

http://www.deluxeblogtips.com/wordpress-include-template-files/

#Wordpress

Agnieszka Trefler

Agnieszka Trefler (Ruda) - freelancer, web developer, specjalistka od WordPressa z Wrocławia. Z pasją budowania stron, blogowania i fotografowania. Twórca Inspiracji fotograficznych.