anatomy of a wordpress theme
TRANSCRIPT
![Page 1: Anatomy of a WordPress Theme](https://reader036.vdocuments.us/reader036/viewer/2022083115/58d026f51a28ab04288b46fd/html5/thumbnails/1.jpg)
Anatomy of a WordPress Theme
Pittsburgh WordPress Anonymous Group
![Page 2: Anatomy of a WordPress Theme](https://reader036.vdocuments.us/reader036/viewer/2022083115/58d026f51a28ab04288b46fd/html5/thumbnails/2.jpg)
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.
![Page 3: Anatomy of a WordPress Theme](https://reader036.vdocuments.us/reader036/viewer/2022083115/58d026f51a28ab04288b46fd/html5/thumbnails/3.jpg)
Prerequisites Basic knowledge of installing and activating
WordPress themes Basic knowledge of HTML, CSS, and PHP
![Page 4: Anatomy of a WordPress Theme](https://reader036.vdocuments.us/reader036/viewer/2022083115/58d026f51a28ab04288b46fd/html5/thumbnails/4.jpg)
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?
![Page 5: Anatomy of a WordPress Theme](https://reader036.vdocuments.us/reader036/viewer/2022083115/58d026f51a28ab04288b46fd/html5/thumbnails/5.jpg)
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
![Page 6: Anatomy of a WordPress Theme](https://reader036.vdocuments.us/reader036/viewer/2022083115/58d026f51a28ab04288b46fd/html5/thumbnails/6.jpg)
![Page 7: Anatomy of a WordPress Theme](https://reader036.vdocuments.us/reader036/viewer/2022083115/58d026f51a28ab04288b46fd/html5/thumbnails/7.jpg)
Sample index.php[php]<?phpget_header();get_sidebar();if ( have_posts() ) : while ( have_posts() ) : the_post();the_content();endwhile;endif;get_footer(); ?>[/php]
![Page 8: Anatomy of a WordPress Theme](https://reader036.vdocuments.us/reader036/viewer/2022083115/58d026f51a28ab04288b46fd/html5/thumbnails/8.jpg)
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
![Page 9: Anatomy of a WordPress Theme](https://reader036.vdocuments.us/reader036/viewer/2022083115/58d026f51a28ab04288b46fd/html5/thumbnails/9.jpg)
Other files in themes /css/ /js/ /img/ /language/
![Page 10: Anatomy of a WordPress Theme](https://reader036.vdocuments.us/reader036/viewer/2022083115/58d026f51a28ab04288b46fd/html5/thumbnails/10.jpg)
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
![Page 11: Anatomy of a WordPress Theme](https://reader036.vdocuments.us/reader036/viewer/2022083115/58d026f51a28ab04288b46fd/html5/thumbnails/11.jpg)
What is a Child Theme? Child themes us all files from parent theme except those files contained in the child theme folder.