WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm currently working on a website that has a static frontpage and couple of pages that is going to contain portfolio and things alike on the other pages.

The thing I want to do is to hardcode content on the frontpage in css and xhtml.

Is this possible and where do I do this?

I thought it should be done in index.php

in between:

"<?php get_header(); ?>" and "<?php get_footer(); ?>"

calling the content with if and else statement on: is_front_page()

share|improve this question
up vote 1 down vote accepted

I would set up a new page template (see http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates), create a new page (Pages > New) and set it to use that template, and then set WordPress to use that page as the homepage (Settings > Reading). Then you can fill the custom page template with whatever content you want in between wp_head() and wp_footer().

share|improve this answer

Nope, you got it wrong. index.php does usually handle presentation of site's root, but it's also core fallback template for everything else. So you are potentially breake things deeper by trying to edit it like that.

Your options are:

  1. create special front-page.php template for it;
  2. create static page with its own template and assign it to be site's front page.

I suppose either of these might be done already if you say site has static frontpage.

See Template Hierarchy > Front Page Display and Settings Reading SubPanel for documentation.

share|improve this answer

Your Answer


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