Forums

Apend # tag to wp_list_pages links (2 posts)

  1. chess.hoyle
    Member
    Posted 1 year ago #

    I've created a series of pages that have the same header, but different content lower on the page. Is there a way to append to the links that are generated by wp_list_pages, so that clicked links will auto-scroll the user to the content? For example, instead of:

    <li><a href="mysite.com/page-one">Page One</a></li>
    <li><a href="mysite.com/page-two">Page Two</a></li>
    <li><a href="mysite.com/page-three">Page Three</a></li>

    is there a way to make wp_list_pages generate links like:

    <li><a href="mysite.com/page-one#contentDiv">Page One</a></li>
    <li><a href="mysite.com/page-two#contentDiv">Page Two</a></li>
    <li><a href="mysite.com/page-three#contentDiv">Page Three</a></li>

    Thanks!

  2. chess.hoyle
    Member
    Posted 1 year ago #

    Bump.

    Does anyone know if this is even possible?

Topic Closed

This topic has been closed to new replies.

About this Topic