WordPress.org

Ready to get started?Download WordPress

Forums

Where is "wp_list_pages()" defined? (6 posts)

  1. garybeck
    Member
    Posted 4 years ago #

    Hello!

    there is this line of code in my sidebar:

    <?php wp_list_pages(); ?>

    This is doing a fine job displaying my menu, except that it is inserting the word "Pages" above the menu. I want to get rid of the word "Pages" that is automatically inserted.

    I found I can change the word from "Pages" to something else by using this format:

    <?php wp_list_pages('title_li=Menu'); ?>

    But when I remove the title_li definition, it goes to the default "Pages".

    I tried making it invisible like this:

    <?php wp_list_pages('title_li=<font color="white">Menu</font>'); ?>

    This almost works, but there is a bullet next to the invisible text, which I don't want.

    Somewhere the wp_list_pages function has to be defined, where it is inserting "Pages" as the default, putting the LI tags around it, and defining the style of the li tag.

    I've looked all over my stylesheet and can't find anything that helps.

    Does anyone know where I might be able to find where the wp_list_pages is defined, so I can remove the "Pages" at the top of the menu listing, and also the LI tag that is forcing the bullet?

    Please let me know....

    thanks!
    gary in vermont

  2. keesiemeijer
    moderator
    Posted 4 years ago #

    The following example displays no heading text above the list.

    <?php wp_list_pages('title_li='); ?>
  3. garybeck
    Member
    Posted 4 years ago #

    thanks, but I tried that and the result is... it did remove the heading text, but now all the top level menu items are bulleted and the 2nd level menu items are not bulleted but they have extra spacing around them. this is worse than before.

    I just want a simple menu with the 2nd level items indented under the top level items.

    Here are a couple screenshots to see what happened:

    Before:
    http://solarbus.org/temp/anne.jpg

    Then I put in your code and got this:
    http://solarbus.org/temp/anne.jpg

    Any other ideas?
    thanks

  4. garybeck
    Member
    Posted 4 years ago #

    oops, the "before" link should be:
    http://solarbus.org/temp/anne1.jpg

    BTW, is there any way to edit a post on this forum once it's posted?

  5. esmi
    Forum Moderator
    Posted 4 years ago #

    is there any way to edit a post on this forum once it's posted?

    You should be able to access an Edit link to amend your post for about 10 mins after its posted.

    With regard to page list issues, you need to address the bullets and unwanted spaces using your theme's stylesheet.

  6. alchymyth
    Forum Moderator
    Posted 4 years ago #

    try to read and fully understand this paragraph:
    http://codex.wordpress.org/Template_Tags/wp_list_pages#Markup_and_styling_of_page_items

    to keep the same order of ul/li etc for the styling with css when you change to no title, you could try and use:

    <li><ul>
    <?php wp_list_pages('title_li='); ?>
    </li></ul>

    instead of your original:

    <?php wp_list_pages(); ?>

    ( in a correct code, this would have been wrapped in <ul> tags, which you need to keep )

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.