Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Does WordPress work without a theme? If so, then how does it work? Please explain in brief.

If WordPress is displaying content without a theme, what controls the output?

share|improve this question
1  
I think it should show blank page if there is no theme in theme folder. –  Robert hue Sep 5 at 9:07
2  
As far as understand you need to have a theme for Worpdress to work. What are you trying to achieve ie. why are you asking this question? –  stemie Sep 5 at 9:24
3  
No, you don't need a theme for WordPress to work. Theme is mostly for displaying content and if it's not your requirement (may be for a special project) then WordPres will work just fine that way except wp-cron. For that you can use external cron. Also the answer below really sums it up. –  Robert hue Sep 5 at 10:03
    
Do what I did, and use the concept described here, then build your own. –  eyoung100 Sep 5 at 19:10

2 Answers 2

I think there's a song for that:

"Imagine there's no theme. It's easy if you try. No hell below us. Above us only sky ..." ;-)

So in that imaginary dream:

  • you can still fetch the RSS feeds from your site:

    example.com/feed/
    
  • you can still login to your backend:

    example.com/wp-login.php
    
  • you can still access the backend and work there (almost) as usual:

    example.com/wp-admin/
    
  • scheduling posts will not work so you will get the Missed schedule message.

  • wp-cron will not be reliable.

  • you can still access /wp-admin/admin-ajax.php

  • you can use the template_redirect and tempate_include hooks to control the output. Try for example this tiny plugin:

    <?php
    /** Plugin Name: No-Theme-Day **/
    add_action( 'template_redirect', 
        function()
        { 
            echo "Jibby! It's the No-Theme-Day today!"; 
        } 
    );
    
  • ...

ps: Forgive my Friday answer - "But I'm not the only one" ;-)

share|improve this answer
2  
Actually it's perfect answer. –  Robert hue Sep 5 at 9:58
1  
Nice song with and a even nicer implementation. John Lennon would be proud. +1 –  Pieter Goosen Sep 5 at 10:04
2  
Definitely an upvote for the imagine cite :) too bad I can't give you another one for the answer. –  ialocin Sep 5 at 10:04
1  
I totally agree with @ialocin Can unfortunately only give one upvote per answer. –  Pieter Goosen Sep 5 at 10:09

Since using WordPress without theme is quite rare the technicalities of it don't get much attention.

First you have to understand there are multiple "endpoints" in WordPress core dealing with requests.

  • admin side has its own (and numerous) ones, such as wp-admin/index.php.
  • front side almost universally goes through index.php in the very root, but it's usually "hidden" by pretty permalinks

If you take a look at the latter file it has following line:

define('WP_USE_THEMES', true);

So typically WordPress expects front end to always have a theme and configures runtime environment accordingly. This constant doesn't control that much, only if theme templates are going to be loaded in template-loader.php.

Note that it doesn't prevent parent/child themes (if present) to be loaded during core boot process.

So by default WordPress expects at least one theme to be present, enabled, and have templates to be used for purposes of front end display.

This is, however, just a matter of defaults and can be completely configured away. In such case WordPress will continue to fully function on admin side, while on front end side all requests that rely on theme template will cease to display anything.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.