WordPress Theme Frameworks make it easier and more efficient to customise your blog design. Developing for theme frameworks allow you to upgrade the core and add new features to your themes while keeping your customisations untouched.
4. A Theme Framework Is A
Theme Framework Is Not A
Theme Framework
✓ Solid codebase to serve as a
foundation for other projects
✓ Theme hooks (actions & filters)
✓ Like developing a plugin
4
24. Create a Child Theme
• Upload the theme framework (parent theme) to your
themes directory.
• Create a new directory for your child theme and create a
file called style.css in it.
/*
Theme Name: Child Theme
Description: Example Child Theme
Template: parent-theme
*/
/* Import the parent theme style (if you want) */
@import url(../parent-theme/style.css);
24
25. Example: Thematic
Parent Theme
Child Theme
Parent & Child theme must be in the same directory
25
26. Separate your customisations
• Create a file called custom.css in your theme directory.
• Modify your themeʼs header.php by adding the
following between the <head> tags
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/
custom.css" type="text/css" media="screen" />
• Modify the body tag to <body class="custom">
• Implement your customisations in custom.css
.custom #header { /*custom styles for header*/ }
26
28. Learn to use Hooks
• Put your custom functions into functions.php
• Hook the functions into WordPress actions & filters
• E.g. Hook your insertFootNote function to the_content
function insertFootNote($content) {
$content.= "
?>
<div class="footNote">
<p>Don’t forget to subscribe to our RSS feed so you never
miss a post!</p>
</div>
<?php
";
return $content;
}
add_filter ('the_content', 'insertFootNote');
28
30. WP 3.0 Features make
frameworks more powerful
✓ Improved Child Theme support
✓ Custom header image
✓ Custom background image
✓ Simple navigation menus
✓ Author templates
✓ Custom post types & taxonomies
30
31. Theme Frameworks are
The Future
✓ Premium themes will add features
to cater to power users
✓ Regular themes will add features to
become base themes
✓ Site owners benefit from maturity
of themes ecosystem
31
32. Thanks for listening!
David Wang
@blogjunkie
http://blogjunkie.net
http://buzzmedia.com.my
32