Theme Wrangling 101
- 3. A B C
What are
Themes?
Advanced
Usage
Using
Themes
D
Basic
Customizing
- 5. What are Themes?
WordPress stores and serves your
content
!
Plugins extend functionalities by
adding features
!
Themes determine the look of
your site by adding styles and
templates
- 12. .com .org
Over 300 Free and
Premium Themes
!
Secure, never break
your site, WordPress
always up to date
!
Can’t add your own
themes
!
wordpress.com/themes
You can install your
own themes, free or
Premium
!
You do your own
maintenance.
!
Themes can be
insecure
!
Unlimited options
- 18. CSS Customization
Add a stylesheet, don’t change
the theme’s default.
!
custom.css
!
Use a Custom CSS Plugin
(like Jetpack)
- 20. Child Themes
Easy way to develop a theme
without breaking it
!
Means you can always update
the Parent theme without
worrying about breaking your
customizations
!
You can make many themes
based on one theme
- 21. Child Themes
function twentytwelve_child_enqueue_child() {
wp_register_style( 'twentytwelve',
get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'twentytwelve-child',
get_stylesheet_uri(), array( 'twentytwelve' ) );
}
add_action( 'wp_enqueue_scripts',
'twentytwelve_child_enqueue_child' );
Enqueue, dont @import
- 27. Anatomy of a Theme
header.php
index.php sidebar.php
footer.php
- 28. Anatomy of a Theme
header.php
index.php sidebar.php
footer.php
sidebar.php
- 29. Anatomy of a Theme
header.php
index.php sidebar.php
footer.php
- 33. Template Hierarchy
Site Front Page
> front.php
Page
> Page Template
> $custom.php
> page-$slug.php
> page_$id.php
> page.php
Posts
> home.php
!
>> index.php
- 34. Anatomy of a Theme
header.php
front.php sidebar.php
footer.php
- 41. Enqueue it all
wp_enqueue_style( 'slider',
get_template_directory_uri() . '/css/
slider.css',false,'1.1','all');
!
wp_enqueue_script( 'script',
get_template_directory_uri() . '/js/
script.js', array ( 'jquery' ), 1.1,
true);
- 42. The Loop
<?php if ( have_posts() ) : while ( have_posts() ) :
the_post(); ?>
<h1><?php the_title(); ?></h1>
<?php the_content(); ?>
<?php endwhile; else: ?>
<?php _e('Sorry, no posts matched your criteria.'); ?>
<?php endif; ?>