What is the right way to make custom main page?

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?

Related posts

Leave a Reply

2 comments

  1. 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

    OR…

    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