• Resolved sren

    (@sren)


    I have a sidebar like this:

    — About this site
    — Contact me
    — Blah blah

    These are all WP generated pages.
    Now I would like to insert “— home” at the top of the list (just linking to the homepage), but I’m not sure if I can do it with WordPress or if I should write the html. (in that case I will have to write new css styles i guess)

    How should I make it ?

    Thanks.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Assuming you have something like <ul><?php wp_list_pages('title_li=') ;?></ul> you can simply add before the wp_list_pages <li><?php bloginfo('url'); ?></li>

    Thread Starter sren

    (@sren)

    Thanks a lot miklb.
    Actually I have <?php wp_list_pages(‘title_li=<h2>Pages</h2>’ ); ?>
    So I think I would get my homepage link before the h2 title.
    Should I try removing the (‘title_li=<h2>Pages</h2>’ ) and inserting a single h2 tag before my link and the php ?

    Thanks again.

    Yes, if you want home to be above all the other links, otherwise, you can add it to below the existing wp_list_pages

    Thread Starter sren

    (@sren)

    Wow you’re fast miklb!
    I’m working on that, but

    • <?php bloginfo(‘url’); ?>
    • is displayed but not working as a link.
      Sorry, I’m not good at all at PHP ??

      Thanks again

    Sorry
    <li><a href="<?php bloginfo('url'); ?>">Home</a></li>

    should make it a link

    Thread Starter sren

    (@sren)

    Many thanks miklb. ??
    Got it, and working perfectly.

    Someone on another board said I could create a page and add a javascript to redirect it home:

    <SCRIPT LANGUAGE=”JavaScript”>
    function go(){
    window.location.href=”https://www.yourhomepage.com&#8221;
    }
    </script>

    Has anyone tried this? Also I was told I might need an iframe tag. Excuse my neophyte-ness, but what’s an iframe tag?

    Also, if I add the home link to the sidebar php. as suggested in this thread, is that the exact line of code I use? (I’m nothing if very literal.)

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to create a ‘link to home’ page ?’ is closed to new replies.