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.

A theme I am developing depends on there being a static front page. However, there seems to only be one global option to change if front page is static. So when I go to preview the theme, it won't work because the front-page option is off. But I don't want to change the front-page option because the live site will be affected.

Is there a way to change that setting only when certain themes are being viewed?

share|improve this question

1 Answer 1

What I did was this: I just manually coded index.php to be a copy/paste of page.php, pulled the right page from the DB, and echo'ed the content. A code snippet below:

<?php $main_page = get_page_by_title( 'What We Do' ); ?>
<h1><center><?php echo $main_page->post_title; ?></center></h1>

<?php echo $main_page->post_content; ?>

This way my theme works regardless of the front_page options. I realize my code snippet may have details that can be improved, but the spirit of the idea is what I needed to get first.

share|improve this answer

Your Answer


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.