Posts Tagged ‘title’

Custom Home Page for WordPress

By default, WordPress calls the index.php as the home page.

To override the default, I use the home.php instead.

Index.php and Home.php – which is better?

I can’t tell which made a better home; to me it’s a matter of preference.

When using the index file as the home page, I usually set posting to 3 so that it will not stretch too deep down making reading difficult and loading slower.

Or if I remembered to insert “more” to the posting, then maybe 5 to 7 postings per page would provide a quick glance for any first-time visitors.

Using home.php allows me to customize it to anyway I like without affecting the rest of the template.

As in this case, I want the home page to adopt the 1-column look so that it is identical to the web, while the rest of the blog’s files I could have a 2-column template.

I am not sure if it’s alright to leave index.php in the folder.

Can index.php and home.php coexist? I really have no idea.

But having index.php in the folder serves as a backup in case other files needed are not present.

Page Title

The home page displays the blog whereas the single file displays the post title.

While I love the way the blog is being displayed, I would prefer the title to show my Site Concept Keyword – Make Your Own Website.

In order to effect this change, this is what I did to the header.php

I changed the default line of:

<title><php wp_title('«', true, 'right'); ?> <php bloginfo('name'); ?></title>

to :

<title>Starising - Make Your Own WebSite</title>

In short, it means removing the php code and manually insert a title of my choice to the title element.

Having done that, I can no longer named this header.php or every page will display the same title.
So I named this header-home.php

And over at home.php I changed the include code:

<?php get_header(); ?>

to

<?php include (TEMPLATEPATH . '/header-home.php'); ?>

header-home.php

So now I have a new file with only 1 line changed.
Is it worth the effort? Not now…

At a later stage, I would be able to make other changes to the header of the home page especially the setting for the horizontal menu at the header bar.