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 problemsiTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Antihost offers managed WordPress hosting with free migration, one-click staging and a 14-day free trial.
To create a classic WordPress theme from scratch, build a theme folder containing a root-level style.css and index.php, connect the layout to WordPress with template tags and the Loop, then add context-specific templates, hooks, and enqueued assets as the site grows. A classic theme is primarily PHP, JavaScript, and CSS; unlike a block theme, it is not built in the Site Editor.
The reliable workflow is to develop on a configured local or staging site, start with the two-file minimum, split repeated markup into template parts, follow the template hierarchy, register theme features in functions.php, enqueue CSS and JavaScript on the proper hooks, and test every major content context before packaging the theme.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
What a classic WordPress theme is
A classic theme supplies PHP templates that WordPress uses to render requests. Those templates contain ordinary HTML, CSS classes, JavaScript hooks, and WordPress functions such as the_title(), the_content(), get_header(), and get_footer(). WordPress runs the template that best matches the current request and falls back through its hierarchy when a more specific file is absent.
The alternative is a block theme, whose templates and template parts are composed from blocks and edited primarily through the Site Editor. Choose a classic theme when you want PHP-controlled markup, an established template hierarchy, or a code-first workflow. You can still add modern editor features to a classic theme; the distinction is how the site’s structure is authored and selected.
#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 safe development site
Build and test the theme on a configured WordPress installation rather than directly on a live site. A local installation keeps unfinished code private and inexpensive to run. A hosted staging site is useful when clients or teammates need access. The important requirement is a working WordPress site populated with representative content.
Seed the site with realistic cases
- Several posts with different lengths, featured images, categories, tags, and dates.
- Published pages, a nested page, and a page assigned as the posts page if the site uses a static front page.
- Category, tag, date, author, and custom-taxonomy archives where applicable.
- Search results, a deliberately missing URL for the 404 view, and comments if comments are enabled.
- At least one navigation menu and enough sidebar content to exercise widget areas.
Keep administrator access available so you can activate the theme under Appearance → Themes, inspect PHP errors, and switch back to a known-good theme if a template breaks.
Recommended Free Tools
Create the theme directory
Create a unique slug under wp-content/themes/. For example:
wp-content/themes/cedar-classic/
Classic themes do not require a particular set of subfolders. The two files that must be at the theme root are style.css and index.php. You can place additional CSS, JavaScript, images, and PHP modules in subdirectories later, but do not move the main stylesheet out of the root.
Write the required style.css
style.css has two jobs: its header comment supplies theme metadata to WordPress, and the rest of the file contains CSS. A minimal header can look like this:
/*
Theme Name: Cedar Classic
Theme URI: https://example.com/cedar-classic
Author: Your Name
Author URI: https://example.com
Description: A small classic theme built from scratch.
Version: 1.0.0
Text Domain: cedar-classic
*/
:root {
--color-text: #222;
--color-link: #0b57d0;
--content-width: 72rem;
}
body {
color: var(--color-text);
font-family: system-ui, sans-serif;
line-height: 1.6;
margin: 0;
}
.site {
margin-inline: auto;
max-width: var(--content-width);
padding-inline: 1rem;
}
The metadata values identify the theme in the administration screen. Replace the example names and URLs with your own values. Keep the file at the root even after you add an assets/css/ directory; WordPress uses the root file to recognize the theme.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Build index.php and the Loop
index.php is the required catch-all template. It should render the current WordPress query through the Loop and include a useful empty-state message when no posts match.
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.
<?php get_header(); ?>
<main id='primary' class='site-main'>
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<article id='post-<?php the_ID(); ?>' <?php post_class(); ?>>
<header class='entry-header'>
<h2 class='entry-title'>
<a href='<?php echo esc_url( get_permalink() ); ?>'>
<?php the_title(); ?>
</a>
</h2>
</header>
<div class='entry-content'>
<?php the_excerpt(); ?>
</div>
</article>
<?php endwhile; ?>
<?php else : ?>
<p><?php esc_html_e( 'Nothing found.', 'cedar-classic' ); ?></p>
<?php endif; ?>
</main>
<?php get_footer(); ?>
The Loop exposes the posts in the current query. Template tags retrieve fields from the current post, while escaping functions make output safer for the context in which it is printed. Use the_content() when this template is intended to show full content; use the_excerpt() for an archive-style list.
Activate and inspect the first version
- Save both files in
wp-content/themes/cedar-classic/. - Open Appearance → Themes in the WordPress dashboard.
- Activate the theme and visit the front end.
- Confirm that the Loop displays posts, that the stylesheet loads, and that a site with no matching posts shows the empty-state text.
- Open a single post, a page, an archive, a search URL, and a missing URL. At this stage all requests may use
index.php; that is expected.
If activation produces a blank page or a PHP error, switch to another theme, inspect the syntax near the reported line, and reactivate after fixing it. Keep the first version small enough that you can isolate one change at a time.
Split shared markup into reusable files
As soon as more than one template needs the same site chrome, move that markup out of index.php. The conventional files are:
header.phpfor the document start,<head>, branding, and primary navigation.footer.phpfor the closing layout andwp_footer().sidebar.phpfor an optional widget area.template-parts/for repeated fragments such as a post card or content header.
A valid header and footer should include the WordPress hooks that allow plugins and core to print required output:
<!-- 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'>...</header>
<!-- footer.php -->
<footer class='site-footer'>...</footer>
<?php wp_footer(); ?>
</body>
</html>
Load these files with get_header(), get_footer(), and get_sidebar(). For a fragment, use get_template_part( 'template-parts/content', get_post_type() );. Template parts let you change a post card once instead of editing every context that displays it.
Use the template hierarchy deliberately
WordPress maps the request context to a sequence of candidate filenames. It uses the first matching file and continues toward a more general file when a candidate is missing. If no specific template matches, it uses the root index.php.
| Request | Specific templates to add | Fallback direction |
|---|---|---|
| Single post | single-{post-type}-{slug}.php, single-{post-type}.php, single.php |
singular.php then index.php |
| Static page | page-{slug}.php, page-{id}.php, page.php |
singular.php then index.php |
| Category archive | category-{slug}.php, category-{id}.php, category.php |
archive.php then index.php |
| Tag archive | tag-{slug}.php, tag-{id}.php, tag.php |
archive.php then index.php |
| Custom taxonomy | taxonomy-{taxonomy}-{term}.php, taxonomy-{taxonomy}.php, taxonomy.php |
archive.php then index.php |
| Date, author, or post-type archive | Context-specific archive template, then archive-{post-type}.php or archive.php |
index.php |
| Search | search.php |
index.php |
| Missing URL | 404.php |
index.php |
| Front page | front-page.php when present |
Settings-dependent home or blog templates |
Use this hierarchy to express design differences, not to duplicate an entire site. A specialized file can set context-specific headings or wrappers and then load a shared template part for the repeated post markup.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →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.
Add context templates as the design needs them
single.php
Use single.php for one post. Print the full title, metadata, featured image, content, navigation, and comments conditionally. Keep the post loop intact so template tags refer to the correct post.
page.php
Use page.php for static pages. Pages often need a simpler header and no post metadata. If a particular page needs a unique layout, create a slug- or ID-specific file only when that exception is intentional.
archive.php and search.php
Archive and search templates should identify the query to the reader, iterate through results, and provide pagination. Include an explicit no-results branch rather than leaving an empty region.
404.php
A 404 template should explain that the requested resource was not found and offer a search form or navigation back to useful content. It should not return a successful-looking article page for a missing URL.
Free tools Windows power users keep installed
One-click scans. No signup required.
When a template needs pagination, use the appropriate WordPress pagination function after the Loop and test both the first and later pages. Do not assume that the home page, a static front page, and the posts page share the same query.
Use functions.php for theme setup
functions.php is loaded as theme setup code. It is the right place to register presentation-related features, menus, widget areas, and asset hooks. It is not a durable replacement for a plugin: business rules, custom post types, data migrations, and functionality that must survive a theme change belong in a plugin.
<?php
function cedar_classic_setup() {
add_theme_support( 'title-tag' );
add_theme_support( 'post-thumbnails' );
add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', 'style', 'script' ) );
register_nav_menus(
array(
'primary' => __( 'Primary Menu', 'cedar-classic' ),
'footer' => __( 'Footer Menu', 'cedar-classic' ),
)
);
}
add_action( 'after_setup_theme', 'cedar_classic_setup' );
function cedar_classic_widgets() {
register_sidebar(
array(
'name' => __( 'Sidebar', 'cedar-classic' ),
'id' => 'sidebar-1',
'description' => __( 'Widgets shown in the main sidebar.', 'cedar-classic' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
}
add_action( 'widgets_init', 'cedar_classic_widgets' );
Use a unique function prefix or a namespace to avoid collisions with plugins and other themes. Localize user-facing strings with the theme text domain, and keep the text domain consistent with the theme slug.
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
Enqueue CSS and JavaScript correctly
The proper way to load theme styles and scripts is to enqueue them from functions.php on WordPress hooks. Do not hard-code stylesheet or script tags in header.php; hard-coded tags bypass dependency handling, versioning, and conditional loading.
function cedar_classic_assets() {
$theme = wp_get_theme();
wp_enqueue_style(
'cedar-classic-style',
get_stylesheet_uri(),
array(),
$theme->get( 'Version' )
);
wp_enqueue_script(
'cedar-classic-navigation',
get_theme_file_uri( 'assets/js/navigation.js' ),
array(),
$theme->get( 'Version' ),
array( 'in_footer' => true, 'strategy' => 'defer' )
);
}
add_action( 'wp_enqueue_scripts', 'cedar_classic_assets' );
get_stylesheet_uri() points to the root style.css. Additional files can be addressed with get_theme_file_uri(). Declare dependencies in the third argument, provide a version so browsers can receive updated files, and load scripts in the footer when they do not need to run in the document head. If an asset is needed only on one template, check the relevant conditional tag before enqueueing it.
Adopt a maintainable folder structure
A two-file theme is ideal for learning the request flow. A production theme benefits from predictable separation:
cedar-classic/
├── style.css
├── index.php
├── functions.php
├── header.php
├── footer.php
├── sidebar.php
├── single.php
├── page.php
├── archive.php
├── search.php
├── 404.php
├── template-parts/
│ ├── content.php
│ ├── content-page.php
│ └── content-none.php
├── assets/
│ ├── css/
│ ├── js/
│ └── images/
└── inc/
├── template-functions.php
└── customizer.php
There is no mandatory directory name beyond keeping style.css at the root. Use template-parts for reusable markup, assets for front-end files, and inc for grouped PHP modules when functions.php becomes difficult to navigate. Require those modules from functions.php with clear paths.
Keep presentation in the theme and durable behavior in plugins
Theme code should define how content looks: wrappers, typography, navigation presentation, image sizes, and template output. A plugin should own features that must remain when the site changes themes, such as custom post types, business rules, integrations, shortcodes containing important data, and scheduled processing. If a theme registers a content type that the next theme cannot provide, changing the theme can make that content inaccessible in the editor even though the database records remain.
Write templates that are safe, accessible, and translatable
- Escape output for its context: URLs with
esc_url(), attributes withesc_attr(), and plain text withesc_html(). Use trusted WordPress functions such asthe_title()andthe_content()according to their intended output. - Use semantic landmarks such as
header,nav,main, andfooter, and give repeated navigation an accessible label. - Make keyboard focus visible, preserve a logical heading order, provide meaningful alternative text through the media workflow, and ensure controls are usable without a mouse.
- Wrap visible strings in translation functions and use the same text domain declared in
style.css. - Do not trust values from query strings, post metadata, or custom fields merely because they came from the WordPress database; validate and escape them at output.
These practices improve interoperability, security, and the ability to translate the theme. Follow the WordPress Coding Standards while you develop instead of trying to retrofit them after the theme is complete.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Choose between a minimal and modular build
| Approach | Best for | Strength | Cost |
|---|---|---|---|
| Minimal two-file theme | Learning, prototypes, or a very small site | Fast feedback: only style.css and index.php are required |
Repeated markup and one catch-all design become harder to maintain |
| Modular classic theme | Client sites, long-lived projects, or multiple content types | Context templates, template parts, organized assets, and separated setup code | More files and conventions to document |
Start minimal, then split when duplication or context-specific design appears. Do not create a separate template merely to rename one heading if a shared template part and a conditional can express the difference clearly.
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.
Test every query context before release
Testing only the home page misses the failures that occur in a real WordPress installation. Run this matrix on desktop and narrow screens:
- Front page with both latest-posts and static-page configurations.
- Single post with and without a featured image, with long and short titles, and with comments.
- Static page, nested page, and a page using a custom template if you provide one.
- Category, tag, author, date, custom-taxonomy, and custom-post-type archives where supported.
- Search results with matches and without matches.
- 404 page, paginated archives, and posts containing images, lists, quotes, embeds, and long URLs.
- Menu locations with no menu assigned, widget areas with no widgets, and widgets containing long titles.
- Keyboard-only navigation, visible focus, zoomed text, and a screen reader pass.
Use browser developer tools to check console errors, failed asset requests, responsive overflow, and network paths. Run PHP_CodeSniffer with the WordPress Coding Standards to catch formatting, interoperability, translatability, and security problems. Fix warnings that affect output or safety rather than suppressing them blindly.
Troubleshoot common failures
The theme does not appear in Appearance → Themes
Confirm that the directory is directly under wp-content/themes/, that style.css is at the directory root, and that its opening theme comment is valid. A stylesheet nested under assets will not identify the theme.
CSS is missing or an old stylesheet remains cached
Verify that wp_enqueue_style() runs on wp_enqueue_scripts, that the handle is unique, and that the URL resolves to the expected file. Use the theme version as the enqueue version or change it when you release a new build.
A menu or widget area is empty
Registration alone does not place output on the page. Register the location or sidebar during setup, assign a menu or widget in the dashboard, and call wp_nav_menu() or dynamic_sidebar() in the template with a fallback for the unassigned state.
The wrong template is being used
Check the hierarchy from the most specific filename toward index.php. A misspelled slug, an incorrect post-type name, or a file placed in the wrong directory prevents a match. Temporarily add a distinctive HTML comment to candidate files to see which one WordPress selects, then remove the diagnostic.
PHP stops rendering the site
Switch themes from the dashboard or recovery mode, read the reported file and line, and check for an unmatched brace, parenthesis, or quote. Reintroduce the last change after correcting the syntax. Keep a backup or version-control commit before larger refactors.
Package and document the finished theme
- Run the full content and accessibility test matrix on a clean test site.
- Confirm that no development-only URLs, debug output, credentials, or generated caches are included.
- Document the theme name, version, supported WordPress and PHP versions, required plugins, menu locations, widget areas, and known limitations.
- Zip the complete
cedar-classicdirectory itself, preservingstyle.cssandindex.phpat the archive’s theme root. - Install that ZIP on a separate clean site, activate it, and repeat the smoke tests. A package that works only in the original development directory is not ready to distribute.
Keep site-critical functionality in plugins, keep the theme’s public-facing strings translatable, and increment the theme version whenever an asset or behavior change should invalidate a browser cache.
Quick Recap
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.

