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.

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
add comment

2 Answers

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
add comment

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
add comment

Your Answer

 
discard

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