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 am making a custom theme and I want the main page to be a gallery, not a blog,
is it right to change index.php to a gallery page (content wise) or should I use another page?

share|improve this question
up vote 2 down vote accepted

There are definately a few ways of achieving this functionality. I assume by "main page" you mean the home page...

a. Create a new page called "home" b. In your site settings change your homepage to point to the "page" home, rather then grabbing your 10 newest posts. c. Now you have a page hook which you can build a custom template for in one of two ways.

1.) Use wordpress "custom page templates" to create a new template and apply to the new "home" page in "edit page" http://codex.wordpress.org/Theme_Development#Custom_Page_Templates


2.) You can simply create a new file called "page-home.php" (ensuring the slug of your new home page is "home") and WP will use this page template instead....

Solution 2 is more streamlined for progamming if your clients don't need to apply templates themselves.

Hope that's helpful to you

share|improve this answer
thanx, I was looking for a solution that will work out of the box after the theme installation so (2) seems like the right one – ilyo Jun 13 '12 at 7:04

front-page.php may be a more appropriate template. index.php is the fallback for all types so should probably remain generic. see the template hierarchy for details.

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.