Skip to main content

Installing and Activating WordPress Themes

Duration: 35 minutes
Module 4: Session 4.3

Learning Objectives

  • Master all theme installation methods
  • Navigate the WordPress theme repository
  • Upload and install premium themes
  • Install themes via FTP/SFTP
  • Use WP-CLI for theme management
  • Activate and switch between themes
  • Manage theme updates and versions
  • Troubleshoot common installation issues

Introduction to Theme Installation

WordPress offers multiple methods to install themes, each suited for different scenarios. Whether you're using free themes from the repository or premium themes from marketplaces, understanding these installation methods is essential for managing your WordPress site effectively.

💡
Quick Tip
Always create a backup before installing or switching themes, especially on production sites. Theme changes can affect site functionality and appearance.

Theme Sources

🏛️
WordPress Repository
  • Free themes
  • Reviewed for security
  • Easy installation
  • Automatic updates
💎
Premium Marketplaces
  • ThemeForest
  • Elegant Themes
  • StudioPress
  • TemplateMonster
🏢
Theme Developers
  • Direct purchase
  • Custom support
  • Regular updates
  • Documentation
🛠️
Custom Development
  • Tailored solution
  • Unique design
  • Full control
  • No licensing limits
🔍

Method 1: Install from WordPress Repository

The easiest way to install free themes

  1. Navigate to Themes Section

    Go toAppearance → Themesin your WordPress admin dashboard

  2. Click "Add New"

    Click the "Add New" button at the top of the page

  3. Browse or Search

    Use filters (Featured, Popular, Latest) or search for specific themes

  4. Preview Theme

    Click "Preview" to see how the theme looks with your content

  5. Install Theme

    Click "Install" button when you find a suitable theme

  6. Activate Theme

    After installation, click "Activate" to make it your active theme

Add Themes- WordPress Repository
Theme Preview
Astra
By Brainstorm Force
Theme Preview
GeneratePress
By Tom Usborne
📤

Method 2: Upload Theme ZIP File

For premium or custom themes

  1. Prepare Theme File

    Ensure you have the theme in .zip format

  2. Go to Add Themes

    Navigate toAppearance → Themes → Add New

  3. Click Upload Theme

    Click the "Upload Theme" button at the top

  4. Choose File

    Click "Choose File" and select your theme .zip file

  5. Install Now

    Click "Install Now" to upload and install the theme

  6. Activate

    After successful installation, activate the theme

📦

Upload Theme

If you have a theme in a .zip format, you may install it by uploading it here.


⚠️ File Size Limits

Default PHP upload limit is often 2MB. For larger themes, you may need to:

  • Increaseupload_max_filesizein php.ini
  • Increasepost_max_sizein php.ini
  • Use FTP installation method instead
🔧

Method 3: Install via FTP/SFTP

Direct server access method

  1. Extract Theme Files

    Unzip the theme file on your local computer

  2. Connect to Server

    Use FTP client (FileZilla, Cyberduck) to connect to your server

  3. Navigate to Themes Directory

    Go to/wp-content/themes/directory

  4. Upload Theme Folder

    Upload the entire theme folder (not the .zip file)

  5. Check Permissions

    Ensure proper file permissions (755 for folders, 644 for files)

  6. Activate in Admin

    Go to WordPress admin and activate the theme

# Connect via SSH and upload theme
$ ssh user@yourserver.com
$ cd /var/www/html/wp-content/themes/
$ wget https://example.com/mytheme.zip
$ unzip mytheme.zip
$ rm mytheme.zip
$ chown -R www-data:www-data mytheme/
$ chmod -R 755 mytheme/
⌨️

Method 4: Install using WP-CLI

Command-line installation

WP-CLI Commands for Theme Management

# Search for themes
$ wp theme search keyword

# Install theme from repository
$ wp theme install astra

# Install and activate theme
$ wp theme install astra --activate

# Install theme from URL
$ wp theme install https://example.com/theme.zip

# List all themes
$ wp theme list

# Activate a theme
$ wp theme activate twentytwentyfour

# Update theme
$ wp theme update astra

# Update all themes
$ wp theme update --all

# Delete theme
$ wp theme delete oldtheme

# Get theme status
$ wp theme status

Theme Activation and Management

Installed Themes- Manage Your Themes
ActiveCurrent Theme
Twenty Twenty-Four
By WordPress.org
Inactive Theme
Custom Theme
By Your Company

Programmatic Theme Activation

<?php
// Get all themes
$themes = wp_get_themes();

// Check if theme exists
if (array_key_exists('twentytwentyfour', $themes)) {
    // Activate theme
    switch_theme('twentytwentyfour');
    echo 'Theme activated successfully!';
}

// Get current theme
$current_theme = wp_get_theme();
echo 'Active theme: ' . $current_theme->get('Name');

// Check theme compatibility
$php_version = $current_theme->get('RequiresPHP');
$wp_version = $current_theme->get('RequiresWP');

if (version_compare(PHP_VERSION, $php_version, '<')) {
    echo 'Theme requires PHP ' . $php_version;
}

// Get theme information
$theme_name = $current_theme->get('Name');
$theme_version = $current_theme->get('Version');
$theme_author = $current_theme->get('Author');
$theme_description = $current_theme->get('Description');

// Check parent theme (for child themes)
if ($current_theme->parent()) {
    $parent_theme = $current_theme->parent();
    echo 'Parent theme: ' . $parent_theme->get('Name');
}
?>

Theme Requirements and Compatibility

Requirement Minimum Recommended Check Method
WordPress Version 5.0+ Latest get_bloginfo('version')
PHP Version 7.4+ 8.0+ phpversion()
MySQL Version 5.6+ 8.0+ $wpdb->db_version()
Memory Limit 64MB 256MB WP_MEMORY_LIMIT
Upload Size 2MB 64MB wp_max_upload_size()

Troubleshooting Common Issues

🔴 White Screen of Death After Activation

Causes:PHP errors, memory limit, incompatible theme

Solutions:

  • Enable debugging:define('WP_DEBUG', true);
  • Increase memory limit:define('WP_MEMORY_LIMIT', '256M');
  • Rename theme folder via FTP to deactivate
  • Check error logs for specific issues

🔴 "Are you sure you want to do this?" Error

Causes:File too large, corrupted file, timeout

Solutions:

  • Increasemax_execution_timein php.ini
  • Use FTP installation method
  • Check file isn't corrupted
  • Clear browser cache and cookies

🔴 Theme Installed but Not Showing

Causes:Missing files, incorrect folder structure

Solutions:

  • Verify style.css exists with proper header
  • Check index.php is present
  • Ensure folder is directly in /themes/ directory
  • Fix file permissions (755 for folders, 644 for files)

Common Permission Issues

# Fix theme permissions via SSH
chmod -R 755 wp-content/themes/your-theme
chown -R www-data:www-data wp-content/themes/your-theme

# Or for all themes
find wp-content/themes -type d -exec chmod 755 {} \;
find wp-content/themes -type f -exec chmod 644 {} \;

Managing Theme Updates

Theme Update Management
Auto-updates:
Enable for repository themes only
Staging Test:
Always test updates on staging first
Backup:
Create backup before major updates
Child Theme:
Preserves customizations during updates

Enable Auto-Updates

<?php
// Enable auto-updates for all themes
add_filter('auto_update_theme', '__return_true');

// Enable for specific theme
add_filter('auto_update_theme', function($update, $theme) {
    if ($theme->get_stylesheet() === 'twentytwentyfour') {
        return true;
    }
    return $update;
}, 10, 2);

// Disable auto-updates
add_filter('auto_update_theme', '__return_false');

// Check for updates programmatically
$updates = get_site_transient('update_themes');
if (isset($updates->response['theme-name'])) {
    echo 'Update available for theme';
}
?>

Best Practices

✅ Installation Best Practices

  • Always backupbefore installing or switching themes
  • Test on stagingenvironment first
  • Check compatibilitywith your WordPress and PHP versions
  • Read documentationprovided by theme developers
  • Keep one default themeas a fallback option
  • Delete unused themesto reduce security risks
  • Use child themesfor customizations
  • Verify theme sourceto avoid malicious code
  • Monitor performanceafter theme activation
  • Set up staging sitefor testing new themes

Practice Exercise

💻
Hands-On Practice
  1. Install a free theme from WordPress repository
  2. Preview the theme before activation
  3. Download a free theme ZIP file and install via upload
  4. Practice FTP installation with a theme
  5. Use WP-CLI to install and activate a theme
  6. Switch between multiple themes
  7. Check theme requirements and compatibility
  8. Enable auto-updates for a specific theme
  9. Delete an unused theme
  10. Troubleshoot a theme installation issue

Additional Resources