• 3D
  • Illustration
  • Web Design
WordPress Home Link: The Hidden Secret

Here’s something offered in WordPress 2.7 that I happened to stumble upon randomly in a forum, but is nowhere to be found on the WordPress website (not very readily, anyways):

What do you do when you want the homepage link to be a link to the posts page, and not a static page? For anyone that has used WordPress before, you know that this is nearly impossible to pull off. No matter what combination of settings you use in the admin “Reading” section, this cannot be done. And trying to do it with the right php tags is just as difficult. Well, WordPress 2.7+ has brought something special to the table. Instead of some creative hacking, you can simply put the right php code in your sidebar (or header) document. Where you would normally place the code:
<?php wp_list_pages('title_li'); ?>

You can now put:
<?php wp_page_menu('show_home=1'); ?>

. . . in its place. This will then create a link called “Home” automatically in your navigation bar, and then list any other pages that you have created, thereafter. The auto-created “Home” link will now take you to the index page, where your posts are listed. Very clever 2.7. Way to go!

This post can also be found on siteCLIQUE.com

Comments:

Leave a Reply

Spam protection by WP Captcha-Free