A theme is a folder inside wp-content/themes that defines how your site looks. Here’s a minimal classic theme structure:
your-theme/
├─ style.css
├─ functions.php
├─ index.php
├─ header.php
├─ footer.php
└─ sidebar.php
style.css (Required Header)
/*
Theme Name: Your Training Theme
Theme URI: https://example.com
Author: You
Description: Minimal learning theme
Version: 1.0.0
License: GPLv2 or later
Text Domain: training-theme
*/
functions.php (Enqueue CSS/JS)
<?php
// Enqueue styles and scripts
add_action( 'wp_enqueue_scripts', function () {
wp_enqueue_style( 'training-style', get_stylesheet_uri(), [], '1.0.0' );
wp_enqueue_script( 'training-app', get_template_directory_uri() . '/app.js', [], '1.0.0', true );
});
index.php (Fallback Template)
<?php get_header(); ?>
<main id="primary" class="site-main">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<article <?php post_class(); ?>>
<h1><?php the_title(); ?></h1>
<div class="entry-content"><?php the_content(); ?></div>
</article>
<?php endwhile; else : ?>
<p><?php esc_html_e( 'No posts found.', 'training-theme' ); ?></p>
<?php endif; ?>
</main>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Template Hierarchy (Quick Peek)
WordPress picks the most specific template file. For single posts, it tries single-{post-type}.php → single.php → index.php. For pages: page-{slug}.php → page.php → index.php.
Block Themes Note
Block themes (FSE) use the /templates and /parts folders with block-based HTML files instead of the classic PHP templates.
