Odovzený vzhled (sub téma) staví na základním tématu vzhledu, čímž vývojářům a designerům šetří mnoho práce.
Výhody:
Dokumentace: Child Themes, Template Hierarchy (Visual Overview image)
/* Theme Name: My subtheme Theme URI: http://theme-web.com (případně web, pro který je šablona vytvářena) Description: Custom theme based on Twenty Ten Author: Name Surname Author URI: http: //author-web.com Template: twentyten Version: 1.0.0 Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready Text Domain: twentyten-child */ /* Import parent style – deprecated */ @import url("../twentyten/style.css"); /* Theme customization starts here -------------------------------------------------------------- */
<?php
function theme_enqueue_styles() {
$parent_style = 'parent-style';
wp_enqueue_style($parent_style, get_template_directory_uri() . '/style.css');
wp_enqueue_style('child-style',
get_stylesheet_directory_uri() . '/style.css',
array($parent_style)
);
}
add_action('wp_enqueue_scripts', 'theme_enqueue_styles');
?><?php
if (!function_exists("my_function")) {
function my_function($parameter = true) {
echo "My Custom Function";
}
} //endif functions_exists
// Include favicon link to head section
if (!function_exists("favicon_link")) {
function favicon_link() {
echo '<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />' . "\n";
}
add_action('wp_head', 'favicon_link');
} //endif functions_exists
// Get actual stylesheet directory path
require_once(get_stylesheet_directory() . '/my_included_file.php');
?>