• bpering

    (@bpering)


    Hi all,

    I am using the “gone fishing” theme. I have a PAGE heading in the sidebar with 5 linkable pages listed below the heading. I want to add a linkable HOME page to that menu, where all my posts would go. (meaning that clicking on “home” would take me to the latest post, and other posts below that one, etc).

    I have tried making a blank home page, and in Settings / General, sending posts to the newly created page, but a permalink “home” is automatically added to the URL, which takes the visitor to a blank page.

    If I could eliminate the permalink for that one “home” page, that would work, but I can’t figure out how to do that

    Here is the blog URL, if that will help: https://badcrediteliminated.com/

    Thanks for any help,

    Bob

Viewing 15 replies - 1 through 15 (of 27 total)
  • esmi

    (@esmi)

    Try editing your theme’s sidebar.php file and, just above <?php wp_list_pages();?>, add:

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

    Thread Starter bpering

    (@bpering)

    Thanks esmi, but that didn’t work.

    This is the Sidebar code I have for pages:

    <h2>Pages</h2>
    
          <?php
    
          wp_list_pages('sort_column=menu_order&title_li='); ?>
    MichaelH

    (@michaelh)

    Use show_home=1 with the template tag, wp_page_menu().

    Thread Starter bpering

    (@bpering)

    Thanks MichaelH, I understand you want me to change show_home=0 to show_home=1, but where do I find the template tag, wp_page_menu()?

    I am pretty new at this. Sorry.

    Bob

    MichaelH

    (@michaelh)

    You would replace wp_list_pages with wp_page_menu. Review that link for other arguments…

    Related:
    Stepping Into Template Tags
    Stepping Into Templates
    Template Hierarchy

    Thread Starter bpering

    (@bpering)

    I changed the page PHP code like this, but it still doesn’t work. Did I do it right?

    li><h2>Pages</h2>

      <?php

      wp_page_menu(‘show_home=1, sort_column=menu_order&title_li=’); ?>

    MichaelH

    (@michaelh)

    try:

    <?php wp_page_menu('show_home=1'); ?>

    Thread Starter bpering

    (@bpering)

    I get this error:

    arse error: syntax error, unexpected ‘<‘ in /home/bbrd1/public_html/badcrediteliminated.com/wp-content/themes/gone-fishing/sidebar.php on line 26

    Thread Starter bpering

    (@bpering)

    Opps! Copied it in wrong. However… it still didn.t add HOME to the menu.

    Any other suggestions?

    matt987

    (@matt987)

    Try putting this in <a href="<?php echo get_settings('home'); ?>/"><?php _e('Home'); ?></a>

    MichaelH

    (@michaelh)

    This worked perfectly in the wp-content/themes/default/sidebar.php with the WordPress Default theme:

    <h2>Pages</h2>
    <?php wp_page_menu('show_home=1'); ?>
    matt987

    (@matt987)

    MichaelH, for some reason this thread isn’t displaying properly. I’m using IE8. Just thought I’d mention it just in case your still here.

    Thread Starter bpering

    (@bpering)

    Maybe this theme (gone-fishing) is different. Still no Home page.

    Here is how I have the Pages code in the Sidebar template now.

    <li><h2>Pages</h2>
    <ul>
    <h2>Pages</h2>
    
          <?php
    
          wp_page_menu('sort_column=menu_order&title_li='); ?>
    				</ul>
    </li>

    MichaelH

    (@michaelh)

    <h2>Pages</h2>
    
          <?php
    
          wp_page_menu('show_home=1&sort_column=menu_order&title_li='); ?>
    esmi

    (@esmi)

    @matt987: Fixed. Unescaped code posted early in in the thread. Thanks for the heads-up.

Viewing 15 replies - 1 through 15 (of 27 total)
  • The topic ‘Need a HOME page added to page menu’ is closed to new replies.