Here is another guest post by Brian explaining how to tweak the home page display.
Many people new to blogging and WordPress, and some intermediates, are a little confused about what actually is their home page.
Let us start by defining the home page in the greater scheme of things. The home page is the first page a browser opens when directed at a website or when the website’s "home" button is pressed.
For a newly installed WordPress installation that hasn’t been tweaked the home page is a page showing your last 10 posts (posts..... not pages), so when you click the ‘Home’ tab on the Grace themes in the top left, this is where you end up.
As can be expected of WordPress, this can be altered, and very simply as well. You’ll need to open up your admin panel and under ‘Settings’ go to ‘Reading’.
-
You are given the choice to have your home page open as a typical blog, showing posts, or onto a single page, like a traditional website.
-
If you have chosen a page, you must now tell WordPress which one you wish to display. Note – the drop down list will only show published pages.
-
Finally, WordPress needs to know how to access your posts. So again you are presented with a choice of pages to display your blog on.
One problem people find...and can’t deal with.... after they select a page to be their home page is that the tab for that page appears at the top left of the blog on the page menu even though the tab ’Home’ is there. Like a dual link! For this fix head over into the theme editor and open the header.php
The following code controls the ‘page menu’ bar at the top of the blog. With some tweaking this bar can display anything you want.
<div id="menu"> <ul> <li><a href="<?php echo get_option('home'); ?>/" >Home</a></li> <?php wp_list_pages('sort_column=menu_order&include=2,16&title_li='); ?> </ul> </div> |
Some basic changes were mentioned in this previous tutorial. However the example I gave was a very basic HTML example. For a more in-depth look at what can be done with the page menu look at the WordPress page on Page Template Tags.
Here is the basic way to avoid the extra home page tab.
Find the page id number (either hover over it in the ‘admin panel/edit pages’ list and look at the URL, or install the plugin Restore ID), then in header.php turn this –
<?php wp_list_pages('sort_column=menu_order&title_li='); ?>
Into this –
<?php wp_list_pages('sort_column=menu_order&exclude=2&title_li='); ?>
…using the correct page ID.
Some people don’t like the word ‘Home’ to be displayed in that tab. Well change it then! In the code above change the word ‘Home’ .
Suggested reading:
- Ask the WordPress Guru, Q&A #1
- Do it Yourself: Optimize your WordPress Page Headings
- 5 cool WordPress plugins you never heard about
Posted in: WordPress
TAGS:change home button wordpress, change wordpress page tabs, get_option home page, grace theme, recent post, tweak comment posts wordpress, tweak wordpress homepage, tweaking wordpress, wordpress change home tab, wordpress change page, wordpress home page, wordpress home pages, wordpress homepage example, wordpress homepage excerpts plugin, wordpress page home page, wordpress tweaks







12 Comments
Hi,
I have an onsite blog at http://www.criminaldefenseduilawyer.com/blog/ . This is a wordpress site where a static page is displayed on the homepage and the posts are going to a static page called 'blog'. The configurations are done within wordpress's configuration guidelines shown in this article.
The problem I am experiencing is that the 'blog' page is a static page and its last update date is an old date, the one when the page was last edited. However, I have posts coming to that page almost every day. So in reality it is being updated much more frequently. Please see the sitemap where for the last modified date: http://www.criminaldefenseduilawyer.com/sitemap.xml
I suspect that this confuses search engines and and they also see the blog page http://www.criminaldefenseduilawyer.com/blog/ last updated much earlier than the real date. This results in the fact that the category and tag pages are more popular than the blog page, while these are getting rarely updated compared with the http://www.criminaldefenseduilawyer.com/blog/ page.
My question is how can I use wordpress's functionality of displaying posts on a static page instead of the homepage and having a correct last modified date for that static page, so that the search engines also know that this page is being updated almost every day.
Hi Ruzzana,
Are you using a plugin for the sitemap? I use the Google XML Sitemap Generator plugin and have no problems with posts being displayed on Google searches 10 mins after being posted, despite the age of the 'blog page'.
I understand your point about the initial creation date of the page but I have never in all my studying of wordpress SEO heard of it being an issue.
thanks for the answer Brian, i am also using google xml sitemap creator and i have always been indexed in a few minuter after posting. ironically, after making changes to wordpress theme, everything went wrong. and the date of my 'blog' page was last updated is that very exact date when my site's appearance in serps went down.
I have a question along these lines, that I can't find an answer to...
I am using the a static page for my home page, but I would like to set a div above the start of that page's content with the title and possibly the excerpt to the most recent post (just one). I don't know the codex well enough to figure out how to make that info show up.
Is this an easy piece of code to implement?
Hi Tom,
Look up WordPress Conditional Tags - is_front_page()
Then find the Template Tag for recent post.
And glue it together!
Then put between 'divs' in the appropriate place in the index file.
Ok - thanks - I got the is_front_page() working... but when I use the tag for wp_get_recent_posts( '1' ) and then displaying the title - it is showing the title of the current page - not the most recent post. I will try to dig around more when I have another chance (after work, or tomorrow at lunch) but any other ideas on why I am pulling the static page title may help.
And - thanks for 'pointing me' - it helps to learn the codex more than just copy paste (albeit, not as easy)
Always good information, Vladimir! I do some of the WordPress stuff myself but usually outsource to code gurus like you, but I have a quick question I'd love to solve and it is inline with this article which also solves one of my problems on another site, so thank you and in advance for answering the question - I'll try to make it a yes or no for you...
In this same line
<a href="/" >Home
Am I able to remove the link and replace it with my own to redirect the home page?
/
What I would love to see work is:
Home
My blog is seperate from the site, so I would love the Blog's Home button to actually go to the site home... is this how I would do it? I think I overworded the question - my apologies.
Thanks for all the good information!
Ya whoops... ill paste in an email good thing I copied before posting. Feel free to delete both comments...
As I said in the email, yes it is possible to redirect 'home' to whatever you need to be there.
how is it possible to change my home button in wordpress to point to a different link?
i would love for you to answer this!
thanks!
Please: get_settings is deprecated in version 2.1 and i think, a new tutorial use the right functions: get_option or in your example: get_bloginfo or bloginfo without echo.
Sorry for my bad english.
Best regards
Nice catch, updated the post. Thanks.