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?

2 Answers 2


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

  • 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, 2012 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.