Starting the MRP Theme
Master WordPress Theme Development From Static to Dynamic
Essential WordPress Theme Components
Theme Structure
WordPress themes require specific files and folder organization within the wp-content/themes directory to function properly.
Dynamic Content
PHP functions replace static HTML content to create dynamic, database-driven websites that update automatically.
File Integration
Proper linking of stylesheets, scripts, and images ensures themes work across different WordPress installations.
Theme Development Workflow
Create Theme Foundation
Set up the theme folder structure with required index.php and style.css files in the wp-content/themes directory
Configure Theme Information
Add proper header comments to style.css containing theme name, description, author, and version details
Convert Static to Dynamic
Replace static HTML content with WordPress PHP functions to create database-driven dynamic content
Fix Asset Links
Update all links to stylesheets, scripts, and images using WordPress template directory functions
A WordPress theme subdirectory must contain at least two files: index.php for basic page structure and style.css for styles and theme information header.
Theme Name: MRP Blog Theme URI: http://Noble Desktop.com/ Description: Custom theme build for Monteith Restoration & Performance. Author: Your Name Version: 1.0 Tags: Cars, Gray, Two-Column
Unless overridden, the index.php file determines the default layout for all pages in your WordPress site, making it the foundation of your theme structure.
Click Activate beneath your theme's preview.
Click the Monteith Restoration & Performance site title link at the top of the admin to view your activated theme. You'll notice that images and styling appear broken—this is expected and demonstrates why we need to convert static paths to dynamic WordPress functions.
Creating Theme Screenshot
Capture Screenshot
Take a screenshot of the finished static HTML page showing the complete design layout
Resize Image
Resize the screenshot to exactly 300px wide by 225px high for proper theme preview display
Save as PNG
Save the file as screenshot.png in the root level of the theme folder for WordPress recognition
PHP Fundamentals for WordPress
PHP Tags
PHP code is wrapped inside opening <?php and closing ?> tags, similar to HTML tag structure.
WordPress Functions
Functions execute code blocks to pull database information and generate HTML following the format <?php function_name(); ?>
Function Arguments
Functions can receive extra information in parentheses to perform different actions like <?php function_name('extra info'); ?>
Semi-colons at the end of each PHP statement are essential. Missing semi-colons cause errors and may result in blank pages or sections.
Static vs Dynamic Title Implementation
| Feature | Static HTML | Dynamic PHP |
|---|---|---|
| Title Content | Fixed text in HTML | <?php bloginfo('name'); ?><?php wp_title(); ?> |
| Flexibility | Manual updates required | Automatically updates from database |
| Maintenance | Edit each page individually | Single function updates all pages |
Link Update Requirements
Ensures correct path to theme's style.css file across all pages
Dynamically generates correct path to theme folder for script files
Prevents broken images when theme is used on different WordPress installations
Creates dynamic link to site homepage regardless of domain or subdirectory
Navigation Implementation Comparison
| Feature | Static HTML | Dynamic WordPress |
|---|---|---|
| Code Structure | Manual <ul><li> list | <?php wp_nav_menu(); ?> function |
| Content Updates | Edit HTML for each change | Automatic from WordPress Dashboard |
| Page Management | Static list of pages | Dynamic based on published pages |
Key Takeaways

