Témata vzhledu jsou dostupná zdarma na stránce Free Themes Directory.
Existuje ale i možnost koupit profesionální řešení vzhledu:
Responzivní témata:
Tipy:
Used:
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');
?>
Dokumentace:


Návody:
my_theme/
Příklad zobrazení nadpisu:
<?php the_title(); ?>
<?php the_title('<h3>', '</h3>'); ?>Příklad zobrazení "shortcode" (konkrétně plugin Meta Slider):
<?php
// Static homepage and Blog page
if (is_front_page() && is_home()) {
echo do_shortcode("[metaslider id=223]");
}
?>Vlastní "regiony" pro Widgety:
<?php
/**
* Register our sidebars and widgetized areas.
*/
function mytheme_widgets_init() {
register_sidebar(array(
'name' => 'Header Sidebar',
'id' => 'header_sidebar',
'before_widget' => '<div class="header-sidebar">',
'after_widget' => '</div>',
'before_title' => '<h2>',
'after_title' => '</h2>',
));
register_sidebar(array(
'name' => 'Sidebar Top',
'id' => 'sidebar_top',
'before_widget' => '<div class="sidebar-top">',
'after_widget' => '</div>',
'before_title' => '<h2>',
'after_title' => '</h2>',
));
register_sidebar(array(
'name' => 'Sidebar Bottom',
'id' => 'sidebar_bottom',
'before_widget' => '<div class="sidebar-bottom">',
'after_widget' => '</div>',
'before_title' => '<h2>',
'after_title' => '</h2>',
));
}
add_action('widgets_init', 'mytheme_widgets_init');
?><?php
// Header sidebar
if (is_active_sidebar('header_sidebar')) {
dynamic_sidebar('header_sidebar');
}
?><?php if(!function_exists('dynamic_sidebar') || !dynamic_sidebar('header_sidebar')): ?>
<?php endif; ?><?php
// Header sidebar
if (is_active_sidebar('header_sidebar')) {
dynamic_sidebar('sidebar_top');
dynamic_sidebar('sidebar_bottom');
}
?>Nastavení vlastní délky upoutávky příspěvku:
/** * Limit post text by number of characters but do NOT truncate the last word. * * http://codex.wordpress.org/Template_Tags/the_excerpt * http://codex.wordpress.org/Customizing_the_Read_More */ function mytheme_excerpt($limit, $source = null){ if($source == "content" ? ($excerpt = get_the_content()) : ($excerpt = get_the_excerpt())); $excerpt = preg_replace(" (\[.*?\])",'',$excerpt); $excerpt = strip_shortcodes($excerpt); $excerpt = strip_tags($excerpt); $excerpt = substr($excerpt, 0, $limit); $excerpt = substr($excerpt, 0, strripos($excerpt, " ")); $excerpt = trim(preg_replace('/\s+/', ' ', $excerpt)); $excerpt = $excerpt.'... <a href="'.get_permalink($post->ID).'">'.__('more').' »</a>'; return $excerpt; }
<?php echo mytheme_excerpt(200); ?>
<?php echo mytheme_excerpt(200, 'content'); ?>
Zobrazení 10 poslendích příspěvků z kategorie s ID "3" (zobrazení náhledového obrázku vyžaduje plugin "Get The Image"):
<?php
$recent = new WP_Query();
$recent->query('showposts=10&cat=3');
print '<table class="noborder">';
if($recent->have_posts()): while($recent->have_posts()): $recent->the_post();
print '<tr class="text-box"><td style="padding-right: 20px; vertical-align: top;">';
get_the_image(array('default_size' => 'thumbnail', 'width' => '65', 'height' => '65'));
print '</td><td>';
?>
<h3><a href="<?php the_permalink()?>"><?php the_title(); ?></a></h3>
<?php echo '<p>'. get_excerpt(600) .'</p>'; ?>
<?php
print '</td></tr>';
endwhile;
print '</table>';
else:
endif;
?>wordpress:
