Forums

[resolved] wp_page_menu and wp_list_pages display differences (3 posts)

  1. robloranger
    Member
    Posted 2 years ago #

    when i use wp_list_pages everything looks fine but when i try to use wp_page_menu to add the home link the easy way i get a gray bar along the top of the links like my site shows now http://www.robloranger.ca i can't figure out why this is being added using menu vs page list. any ideas? maybe a class? i did try using the classes i saw in the source when using wp_list_pages as the variable for menu_class but it doesn't seem to help.

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    maybe a class

    Almost certainly. wp_page_menu adds a div with a class menu plus <ul> tags by default. wp_list_pages doesn't.

    That extra div is currently creating some validation errors on your page. So re-validating your page after the change to wp_page_menu would probably have given you a big clue. You need to amend the markup in your nav bar template file to accommodate the additional div and ul then edit your stylesheet accordingly.

  3. robloranger
    Member
    Posted 2 years ago #

    nice! thanks so much. i edited the function wp_page_menu to leave out both the '<div> and the

      and now it works great + passes the validation. :-)'

    ul tag that is

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.