Support » Fixing WordPress » Home link under Pages in sidebar – 2.1

  • I’m running 2.1 and want to add a link that will take my readers back to the “home” or front page after they wander away from it. I’d like for it to appear under “Pages” in the sidebar.
    I’ve read about editing the template-functions-post.php file but in 2.1 it has been replaced. I tried modifing post-template.php in the same way but it didn’t work.
    Thanks for your help!

Viewing 6 replies - 1 through 6 (of 6 total)
  • I think you will want to modify your theme’s sidebar.php.

    Thread Starter jackie

    (@jackie)

    If it can be accomplished by modifying the sidebar.php, please tell me how. I don’t understand how you would insert a link into the pages section of the sidebar. I need very specific instructions please 🙂

    Good question jackie – I ahev worked with html for 10 years but am new to blog software and really wonder are all visistors to blogs accustomed to knowing that the header contains a link to Home/front page? It has not been clear to me as I am used to always looking for Home link. I installed my 2.1 yesterday and for past few hours read through most of the posts trying to accomplish putting Home link to sidebar and still have no result – anyomne please help!

    In your WordPress Theme files, find sidebar.php. This is your sidebar template file.

    Every WordPress Theme has similar but different structure for the sidebar links. You will want to look for something labeled “Pages”, though it might be different for your Theme.

    The “correct” structure, replacing the information with your URL and desired effect, would be:

    <ul id="pageslist">
    <li><a href="/index.php" title="Home Page">Home</a></li>
    <li><a href="/index.php?cat=7" title="Category Something">Specific Category Link</a></li>
    <li><a href="http://example2.com/" title="Another Blog">Another Blog Link</a></li>
    <li><a href="http://example.com/a-blog-post" title="A specific post on your blog">A Blog Post Title</a></li>
    <?php wp_list_pages('exclude=2, 6, 4&depth=1&use_desc_for_title=0&sort_column=menu_order&title_li='); ?>
    </ul>

    The above example includes:

    * A link to your home page (index.php)
    * A link to a specific category of posts you might want to feature
    * A link to an external blog, such as another blog of yours or a favorite blog you recommend
    * A link to a specific post (or Page) you may want to feature
    * A list of links to your blog Pages (like About, Contact, etc.) which does not include category IDs for 2, 6 and 4, nor subPages. The list of Pages is in menu order and includes other formating instructions.

    You can mix and match and order this anyway you like in the sidebar.php template file.

    This same structure can work for featuring “static” links in the footer and header if desired.

    I had to do this for a client recently. First thing I tried was creating a custom pages widget, but that somehow made the RSS feed not validate. So what we ended up doing was creating a Page called “Home” and then using this plugin:

    http://asymptomatic.net/2005/03/22/1413/redirectify-plugin/

    and redirected that Page to the home page. Easy and worked like a charm. You can even add links to external pages on your Pages list.

    Hi!
    I wanted to do the same thing! I’m using the basic kubric design. To fix it open the “sidebar.php”

    and replace:
    <?php wp_list_pages("title_li=<h2>Pages</h2>); ?>

    with:
    <?php wp_list_pages("title_li=<h2>Pages</h2><ul><a href=index.php>Blog Home</a></ul>" ); ?>

    hope that helps! cheers 🙂

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Home link under Pages in sidebar – 2.1’ is closed to new replies.