Upload
wp-pittsburgh-meetup-group
View
324
Download
0
Embed Size (px)
Citation preview
Anatomy of a WordPress Theme
Pittsburgh WordPress Anonymous Group
Objective In this module you’ll learn about the different
files that make up a theme and how they work together to display your website.
Prerequisites Basic knowledge of installing and activating
WordPress themes Basic knowledge of HTML, CSS, and PHP
So… Are you familiar with installing and activating
themes via the WordPress Dashboard? Will you have a locally or remotely hosted
sandbox WordPress site to use during class? Do you have a text editor to view PHP, HTML,
CSS, and other files?
What is a theme? Design skin for WordPress website Controls the layout, colors, fonts, etc. for the
WordPress site Built on “blocks” or chunks of code for
different areas of the site Common setup is header.php, index.php,
sidebar.php, and footer.php
Sample index.php[php]<?phpget_header();get_sidebar();if ( have_posts() ) : while ( have_posts() ) : the_post();the_content();endwhile;endif;get_footer(); ?>[/php]
What’s in a theme?
Index.php Style.css Header.php Footer.php Sidebar.php Functions.php Screenshot.png
Single.php Page.php Archive.php Category.php Tag.php Comments.php 404.php Search.php Front-page.php
Other files in themes /css/ /js/ /img/ /language/
Template Heirarchy
WP will always look for post type template first – page.php, single.php. If none, fallback is index.php
For archives – category, tag, all posts, etc., WP looks for specific template firstcategory-tutorial.php, tag-dogs.phpthen basic archive template – category.php or tag.php, and falls back to archive.php
wpheirarchy.com
What is a Child Theme? Child themes us all files from parent theme except those files contained in the child theme folder.