To create a classic WordPress theme, build a folder in wp-content/themes containing a root-level style.css and index.php, then add PHP templates, template parts, hooks, and enqueued assets as the design grows. WordPress uses the template hierarchy to choose the best file for each request and falls back to index.php when no more specific template exists.
Antihost offers managed WordPress hosting with free migration, one-click staging and a 14-day free trial.
This approach gives you direct control over PHP, HTML, CSS, and JavaScript. It differs from a block theme, which is assembled primarily with blocks and edited through the Site Editor. The workflow below takes you from an empty directory to a maintainable, testable classic theme.
As an Amazon Associate I earn from qualifying purchases.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11What a classic WordPress theme is
A classic theme is the original WordPress theme model: it primarily uses PHP, JavaScript, and CSS together with WordPress functions, hooks, and filters. PHP templates decide which markup is rendered, template tags retrieve WordPress data, and CSS and JavaScript control presentation and interaction.
Classic themes are not restricted to a particular WordPress version by their architecture. They can be as small as two files for learning or split into templates, reusable parts, assets, and include files for a larger project. A block theme takes a different route, using block markup and the Site Editor for much of the layout. Choose the classic model when you need PHP-driven templates, a conventional theme hierarchy, or full control over the generated markup.
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
Prepare a WordPress site for development
Build and test on a local or staging WordPress installation before putting the theme on a production site. WordPress’s theme-development guidance assumes you have a configured website to use while building.
Create representative test content
Populate the site with more than one sample post. Include pages, category and other archives, search results, comments, navigation menus, and widget areas. Add long and short titles, featured images where your theme supports them, empty results, and content containing links and lists. This exposes template and layout problems that a single placeholder post will not reveal.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Choose local or hosted staging
- Local development: inexpensive and private, with fast file edits and resets.
- Hosted staging: convenient when a client or team needs to review the work remotely.
The important requirement is a working WordPress site with enough content to exercise the templates. Keep a separate clean installation for final activation tests.
Create the theme directory
- Open the WordPress installation’s
wp-content/themes/directory. - Create a folder using a unique, lowercase slug, such as
newsroom-classic. - Keep the directory name stable once the theme is in use; it is part of the theme’s path and asset URLs.
Classic themes do not require a particular set of subfolders. The one structural rule that matters at this stage is that style.css stays in the theme’s root. You may add folders such as assets, template-parts, and inc later.
Build the two-file minimum
Write the root style.css
style.css is both the stylesheet and the file WordPress reads for theme metadata. Add a theme header comment at the top, followed by your base CSS.
/*
Theme Name: Newsroom Classic
Author: Your Name
Description: A custom classic WordPress theme.
Version: 1.0
Text Domain: newsroom-classic
*/
html {
box-sizing: border-box;
}
*,
*::before,
*::after {
box-sizing: inherit;
}
body {
margin: 0;
color: #222;
background: #fff;
font-family: system-ui, sans-serif;
line-height: 1.6;
}
.site {
max-width: 72rem;
margin: 0 auto;
padding: 0 1rem;
}
The metadata values identify the theme in the administration area. Additional CSS can live under an assets directory, but the root stylesheet must remain present.
Write index.php and the Loop
index.php is the required catch-all template. Start with the Loop, which processes the posts in the current WordPress query, and use template tags to print fields such as the title and content.
<?php get_header(); ?>
<main id="primary" class="site-main">
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<article <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<header class="entry-header">
<?php the_title( '<h2 class="entry-title">', '</h2>' ); ?>
</header>
<div class="entry-content">
<?php the_content(); ?>
</div>
</article>
<?php endwhile; ?>
<?php else : ?>
<p>No content was found.</p>
<?php endif; ?>
</main>
<?php get_footer(); ?>
Activate the theme after saving these files. Open the front end and verify that posts and pages render through the Loop. At this point the theme is intentionally simple; its value is that WordPress can recognize and run it.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Understand the template hierarchy
For every request, WordPress evaluates a sequence of candidate template filenames. It uses the first matching file. If no candidate exists, it uses the theme’s index.php. This hierarchy lets you begin with one fallback and add specialized templates only when a context needs different markup.
| Content or request context | Typical template to add | Purpose |
|---|---|---|
| A single post | single.php |
Layout for an individual post. |
| A WordPress page | page.php |
Layout for a page. |
| An archive | archive.php |
Shared layout for archive listings. |
| Search results | search.php |
Search form results and their empty state. |
| A missing URL | 404.php |
Not-found message and recovery links. |
| Any context without a more specific match | index.php |
Final fallback. |
Do not duplicate the entire site for every context. Start by copying only the structural differences from index.php into a new file. Keep the header, footer, navigation, and content wrappers consistent unless the design genuinely requires a variation.
Free tools Windows power users keep installed
One-click scans. No signup required.
Example single.php
<?php get_header(); ?>
<main id="primary" class="site-main">
<?php while ( have_posts() ) : the_post(); ?>
<article <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<header class="entry-header">
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
</header>
<div class="entry-content">
<?php the_content(); ?>
</div>
</article>
<?php endwhile; ?>
</main>
<?php get_footer(); ?>
The same Loop idea can be adapted for page.php, while archive and search templates normally iterate over a list of results and provide navigation or an explanatory empty state.
Split shared markup into reusable parts
Once more than one template contains the same site shell, move that markup into reusable files. The conventional files are header.php, footer.php, and optionally sidebar.php. Load them with get_header(), get_footer(), and get_sidebar().
header.php
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php wp_body_open(); ?>
<header class="site-header">
<div class="site">
<a class="site-title" href="<?php echo esc_url( home_url( '/' ) ); ?>">
<?php bloginfo( 'name' ); ?>
</a>
</div>
</header>
footer.php
<footer class="site-footer">
<div class="site">
<p>© <?php echo esc_html( gmdate( 'Y' ) ); ?> <?php bloginfo( 'name' ); ?></p>
</div>
</footer>
<?php wp_footer(); ?>
</body>
</html>
The wp_head() and wp_footer() hooks are essential because WordPress and plugins use them to add metadata and enqueued assets. Omitting them can make otherwise correct plugins and scripts fail.
Use template parts for repeated components
For cards, post metadata, comments, or other fragments used in several contexts, create files under template-parts and load them with get_template_part(). A possible structure is:
newsroom-classic/
├── style.css
├── index.php
├── header.php
├── footer.php
├── sidebar.php
├── single.php
├── page.php
├── archive.php
├── search.php
├── 404.php
├── functions.php
├── assets/
│ ├── css/
│ ├── js/
│ └── images/
├── template-parts/
│ ├── content.php
│ ├── content-single.php
│ └── content-none.php
└── inc/
├── setup.php
└── customizer.php
No subfolder is mandatory. This layout is a maintainability choice: assets stay together, repeated fragments are discoverable, and grouped PHP responsibilities can move into inc as the theme expands.
Register theme behavior in functions.php
WordPress loads functions.php as theme setup code. Use it to register menus, post thumbnails, title-tag support, widget areas, and other presentation-related behavior. Put durable business rules, content types, and functionality that must survive a theme change in a plugin instead.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Set up common supports and a menu
<?php
function newsroom_classic_setup() {
add_theme_support( 'title-tag' );
add_theme_support( 'post-thumbnails' );
register_nav_menus(
array(
'primary' => __( 'Primary Menu', 'newsroom-classic' ),
)
);
}
add_action( 'after_setup_theme', 'newsroom_classic_setup' );
function newsroom_classic_widgets_init() {
register_sidebar(
array(
'name' => __( 'Sidebar', 'newsroom-classic' ),
'id' => 'sidebar-1',
'description' => __( 'Widgets shown in the sidebar.', 'newsroom-classic' ),
'before_widget' => '<section class="widget %2$s" id="%1$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
}
add_action( 'widgets_init', 'newsroom_classic_widgets_init' );
Call the registered menu from a template where it belongs:
<?php
wp_nav_menu(
array(
'theme_location' => 'primary',
'container' => 'nav',
'container_class' => 'primary-navigation',
)
);
?>
Use translation functions for user-facing strings and keep the text domain consistent with the theme slug.
Enqueue CSS and JavaScript correctly
The proper way to add scripts and styles is to enqueue them from functions.php on the appropriate WordPress hooks. Do not hard-code <link> or <script> elements in header.php.
<?php
function newsroom_classic_assets() {
$theme_version = wp_get_theme()->get( 'Version' );
wp_enqueue_style(
'newsroom-classic-style',
get_stylesheet_uri(),
array(),
$theme_version
);
wp_enqueue_script(
'newsroom-classic-navigation',
get_theme_file_uri( 'assets/js/navigation.js' ),
array(),
$theme_version,
true
);
}
add_action( 'wp_enqueue_scripts', 'newsroom_classic_assets' );
get_stylesheet_uri() points to the root style.css. Additional files can be addressed with get_theme_file_uri(). A version derived from the theme metadata helps browsers recognize a changed asset when you release a new theme version.
Load assets only where needed
If a script belongs only to one template, conditionally enqueue it inside the asset callback using the relevant WordPress conditional function. Keep the callback focused on registration and avoid printing JavaScript directly from templates. Ensure your header and footer retain wp_head() and wp_footer() so the enqueued files have output locations.
Keep presentation in the theme and durable logic in plugins
A theme should control presentation: layout, typography, template markup, menus, widget areas, and visual supports. A plugin should own business rules and content that must remain when the site owner changes themes. Examples include custom post types, important taxonomies, data-processing workflows, and site-critical integrations.
This separation prevents a redesign from removing content or operational behavior. If a function is required for the site’s identity rather than its appearance, it generally belongs outside the theme.
Grow from a minimal theme to a modular project
Start with the smallest useful change
Keep the two-file theme while learning the Loop and template tags. Add header.php and footer.php when markup is repeated. Add context templates when a request needs a different structure. This sequence keeps each failure easy to isolate.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Adopt folders when they solve a problem
assets/for JavaScript, additional CSS, fonts, and images.template-parts/for repeated content fragments.inc/for grouped setup, customizer, or integration code loaded byfunctions.php.
Do not move style.css out of the root. WordPress needs that location for theme recognition and metadata even if most of your CSS is organized elsewhere.
Load grouped files from functions.php
<?php
require get_theme_file_path( 'inc/setup.php' );
require get_theme_file_path( 'inc/widgets.php' );
Use a consistent naming prefix for functions and handles so your code does not collide with WordPress, plugins, or another theme.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsMake templates safe, accessible, and translatable
Escape values at output: URLs with esc_url(), visible text with esc_html(), and attribute values with the appropriate escaping function. Use WordPress template tags instead of printing database values directly. Keep semantic headings in a logical order, label navigation, provide keyboard access to interactive controls, and ensure focus states remain visible.
Use translation functions for text a site owner may need to translate. Give every translatable string the theme’s text domain. Include meaningful alternative text when outputting images and make empty search, archive, and 404 states understandable rather than leaving a blank page.
Test every major query context
Activate the theme on the development site and work through a repeatable checklist:
- Home and blog listings show the expected Loop output.
- Single posts and pages use their specialized templates when present.
- Archives, search results, and empty searches have usable layouts.
- The 404 template offers a clear way back to working content.
- Comments, menus, and widget areas render when configured.
- Featured images and posts without featured images both have acceptable layouts.
- Long titles, long words, lists, tables, quotes, and embedded media do not break the design.
- The layout works at narrow and wide viewport sizes.
- Keyboard-only navigation reaches every interactive element.
- Enqueued CSS and JavaScript load without missing-file errors.
Test both a populated site and a clean installation. A theme that works only with the developer’s sample content is not finished.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Check code quality with WordPress standards
Run PHP_CodeSniffer with the WordPress Coding Standards. These standards address coding style, interoperability, translatability, and security. They are especially useful for finding inconsistent naming, unsafe output, and patterns that make a theme harder for other WordPress installations to use.
Review the warnings rather than suppressing them blindly. Some projects need documented exceptions, but most early warnings point to a fix in escaping, hook usage, internationalization, or code organization. Also inspect browser behavior manually: automated checks cannot replace responsive, keyboard, and content-context testing.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Package and hand off the theme
- Remove development-only files, unused assets, and test content from the theme directory.
- Confirm that
style.cssis at the root and that all required PHP includes use paths that work on another installation. - Zip the complete theme directory, preserving its folder name.
- Install the zip on a clean test site through the Themes screen and activate it.
- Repeat the major-context and accessibility checks after installation rather than testing only from the development folder.
- Document the WordPress and PHP versions you support, the theme’s available menus and widget areas, required plugins, and known limitations.
Documenting support boundaries matters because WordPress APIs, PHP compatibility, accessibility guidance, and theme-review expectations can change. Recheck the current WordPress handbook when you update the theme or target a new environment.
Common problems and precise fixes
The theme does not appear in Appearance → Themes
Check that the directory is directly under wp-content/themes/, that style.css is in the directory root, and that the stylesheet contains a valid theme header comment. A nested zip folder or a stylesheet placed under assets prevents normal detection.
Recommended Free Tools
The page is blank or the layout is missing plugin output
Confirm that get_header() and get_footer() are called where expected and that header.php contains wp_head() while footer.php contains wp_footer(). Check PHP syntax and the browser’s network panel for missing asset paths.
The wrong template is being used
Identify the request context, then check whether a more specific file exists with the expected name. WordPress always chooses the first matching candidate in the hierarchy; if none matches, it deliberately falls back to index.php. Add or correct the context template rather than trying to force a different file from inside the Loop.
Styles or scripts do not update
Verify that the enqueue callback is attached to wp_enqueue_scripts, that the file path is correct, and that the template calls the head and footer hooks. Change the theme version when releasing updated assets so clients receive the new files.
Changing themes removes important functionality
Move that functionality into a plugin. Theme files should describe presentation; content rules and business logic need a component that remains active independently of the visual design.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Minimal versus modular: choose deliberately
| Approach | Best for | Trade-off |
|---|---|---|
| Two-file minimum | Learning the Loop, template tags, and basic CSS. | Fast to understand, but repeated markup and growing logic become difficult to maintain. |
| Modular templates and parts | Client sites, content-heavy sites, and themes expected to evolve. | More files and conventions to learn, with clearer reuse and safer changes. |
| Direct static markup | Prototyping a visual shell. | Offers immediate visual control but does not display changing WordPress content until template tags and the Loop are introduced. |
| Template tags and hooks | Production themes that must work with WordPress content and plugins. | Requires understanding the query, escaping, hook timing, and the hierarchy. |
Most production themes begin with the minimal form and become modular only where repetition or responsibility boundaries justify it. That keeps the architecture understandable without sacrificing maintainability.
Quick Recap
A practical build order
- Set up a local or staging WordPress site and load representative content.
- Create
wp-content/themes/your-theme-slug/. - Add the root
style.cssheader and base styles. - Add
index.phpwith the Loop and confirm that content renders. - Activate the theme and inspect posts and pages.
- Extract shared markup into
header.php,footer.php, and optional sidebar or template parts. - Add
single.php,page.php,archive.php,search.php, and404.phpas actual design needs arise. - Use
functions.phpfor setup, supports, menus, widgets, and hooks. - Enqueue all CSS and JavaScript through the proper WordPress hooks.
- Organize assets and grouped PHP files as the project grows.
- Run WordPress Coding Standards and perform responsive, keyboard, escaping, translation, and query-context checks.
- Package the theme, install it on a clean site, and document support and limitations.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




