Codeinwp / Codeinwp/wp-maintenance-mode
Activating LightStart corrupts `show_on_front` option, breaking `front-page.php` template loading
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 163
- Forks
- 82
- Avg merge
- 8h 31m
- Merged PRs (30d)
- 8
Description
When LightStart is activated (or maintenance mode is enabled and later disabled), the show_on_front option in wp_options is changed from posts to page, but page_on_front remains 0. This puts WordPress into a broken in-between state where front-page.php no longer loads, and the homepage falls through to index.php showing unstyled posts.
The issue persists after:
- Disabling maintenance mode
- Deactivating the plugin
- Rolling back to a previous plugin version
- Clearing browser cache / testing logged-out
Steps to reproduce
- Set up a WordPress site with a theme that uses a
front-page.phptemplate. - Go to Settings → Reading and set the homepage display to "Your latest posts".
- Confirm the homepage loads correctly via
front-page.php. - Install and activate LightStart.
- Enable maintenance mode
- Do some normal work (edit a post or two).
- Then disable it.
- Visit the homepage.
Expected: Homepage renders usingfront-page.php.
Actual: Homepage shows unstyled posts viaindex.php.
Root cause
Querying the database confirms the corruption:
SELECT option_name, option_value FROM wp_options
WHERE option_name IN ('show_on_front', 'page_on_front');
| option_name | option_value |
|---|---|
| show_on_front | page |
| page_on_front | 0 |
show_on_front has been flipped to page, but no page is assigned (page_on_front = 0). WordPress then evaluates is_home() as true but is_front_page() as false, so the template hierarchy skips front-page.php entirely and falls through to index.php.
The likely cause is that LightStart's maintenance-mode logic sets show_on_front to page (to serve its own landing page) but does not restore the original value on deactivation or when maintenance mode is toggled off.
Workaround
Running this query restores the homepage:
UPDATE wp_options SET option_value = 'posts' WHERE option_name = 'show_on_front';
https://wordpress.org/support/topic/lightstart-activation-preventing-front-page-php-from-loading/
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the maintenance-mode activation and toggle flow described in the issue, focusing on where it changes the WordPress show_on_front and page_on_front options. Reproduce the state using the listed Settings → Reading steps and inspect the homepage template behavior; done means disabling maintenance mode preserves the original option values and front-page.php loads again.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- backend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100