Forums

Add 'Home' to Pages list in Sidebar? (5 posts)

  1. sincewelastspoke
    Member
    Posted 3 years ago #

    Hi,

    I have :

    <?php wp_list_pages('title_li=<h3>' . __('Pages') . '</h3>' ); ?>

    And I want to be able to add a link to my Home Page to the list, preferrably 1st :)

    Any clues gurus?

    Thank you.

  2. myinstinctwaswrong
    Member
    Posted 3 years ago #

    maybe something like?

    <h3>Pages</h3>
    <ul>
    <li>
    <a href="<?php echo get_option('home'); ?>"><?php bloginfo('name'); ?></a>
    </li>
    <?php wp_list_pages('title_li='); ?>
    </ul>

    Basically, pull the title out and do it and the Home link manually, then list the pages.

  3. sincewelastspoke
    Member
    Posted 3 years ago #

    I like your thinking!
    That worked a treat. Many thanks!

  4. sincewelastspoke
    Member
    Posted 3 years ago #

    Just a follow-up side issue.

    How do I display only ONE blog post on my home page(index.php file)?

    Many thanks for any thoughts.

  5. myinstinctwaswrong
    Member
    Posted 3 years ago #

    I can't get to my blog right now to look - but have a look at the single.php file in your template - it's designed to show a single post. Maybe adapt that code to your index.php file.

    There is probably a much more elegant solution, maybe someone else will chime in here.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.