php - Set a separate file as home page in Wordpress -


i've noticed there lot of similar posts, can't seem sift through pile right one.

i'm creating custom theme. have separate file, "foo.php", want un-editable homepage or front page of the site.

then, want use different file/template rest of site.

how do this?

at top of foo.php template, insert following code:

<?php /* template name: home page template */ ?> 

in wordpress, create page called "home" (or really, whatever like). don't need add content using editor if it's in foo.php file. right of editor you'll see dropdown lets choose template - pick 1 created, "home page template".

last, go "reading" section of wordpress dashboard , set newly created page, "home" static front page.


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -