Forums

wp_list_pages with tooltip? (4 posts)

  1. piedro
    Member
    Posted 2 years ago #

    Hello!

    Another question on tooltips:

    I use "wp_list_pages" to create a subnavigation list of available subpages to a certain main page. Works great.

    Now I would like to add tooltips to this list. In a way that the tooltip shows a custom field text or maybe even the corresponding excerpt.

    Does anyone know how to add this functionality to the template tag?

    <?php wp_list_pages('title_li=&child_of=2'); ?>

    thx, p.

  2. MichaelH
    Volunteer
    Posted 2 years ago #

    You would need to use get_pages() for that.

  3. piedro
    Member
    Posted 2 years ago #

    Hi MichaelH!

    Thx. I tried hard to change the code there to use "get_pages" like it said in the article you pointed out, but I don't yet have the skill to get it right:

    <?php $pages = get_pages('child_of='.$pageID = 13.); ?>

    doesn't give me any errorrs but no list or links either.

    Would you post me the right code?

    Thx anyway,
    piedro

  4. MichaelH
    Volunteer
    Posted 2 years ago #

    You need a foreach to iterate through the list of pages. See the examples in that article I pointed to.

Topic Closed

This topic has been closed to new replies.

About this Topic