Support » Themes and Templates » Add link back to home page

  • Resolved digne

    (@digne)


    Can someone help me apply wp_page_menu ( http://codex.wordpress.org/Template_Tags/wp_page_menu ) to my sidebar links?

    I know I need to replace p_list_pages with wp_page_menu, and set “show home” to “true.” But I can’t figure out how. I’m still fairly new to php.

    <ul>
    <?php
    
    // for sidebar widgets
    if ( !function_exists( 'dynamic_sidebar' ) || !dynamic_sidebar( ) )
    {
    
        // search bar
        sp_sidebar_open( "searchbar", "<h2>Search</h2>" );
        include (TEMPLATEPATH . '/searchform.php');
        sp_sidebar_close( );
    
        // pages
        sp_sidebar_open( "pages", "<h2>Pages</h2>" );
            echo '<ul>';
            p_list_pages("title_li=&sort_column=menu_order&class=");
            echo '</ul>';
        sp_sidebar_close( );
    } // sidebar widgets
    
    ?>
    </ul>

    my page: http://sheynawatkins.com/wordpress/
    (uses WordPress 2.3.3)

    The page I will apply all this to: http://www.elizabethhanbury.com/
    (uses WordPress 2.7)

Viewing 3 replies - 1 through 3 (of 3 total)
  • esmi

    (@esmi)

    Forum Moderator

    Try replacing:

    p_list_pages("title_li=&sort_column=menu_order&class=");

    with:

    wp_page_menu('show_home=1&sort_column=menu_order');

    Ohps I missed the w should be:

    wp_list_pages(“title_li=&sort_column=menu_order&class=”);

    I tried that code and doesn’t work. The page fails at that point; see here:

    http://sheynawatkins.com/wordpress/

    Well since nobody here was able to help. I figured it out.

    The problem was my old version of WordPress, I updated and the code worked like magic =))

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add link back to home page’ is closed to new replies.