WordPress.org

Forums

[resolved] Loop through parent pages (3 posts)

  1. danlawson
    Member
    Posted 5 years ago #

    Hi all,

    I am looking for a way of looping through each of the parent pages in my wordpress site?

    I have this static code which i would like to convert to dynamic using this loop:

    <ul class="menu_list">
                        <li><a href="/">Home</a><span>|</span></li>
                        <li><a href="About">About PRM</a><span>|</span></li>
                        <li><a href="Safety-Services">Services</a><span>|</span></li>
                        <li><a href="Contact-Us">Contact Us</a><span>|</span></li>
                        <li><a href="/wp-admin/">Log In</a></li>
    </ul>

    Thanks very much for help with this.

  2. MichaelH
    Member
    Posted 5 years ago #

    Might consider using the template tag, wp_list_pages(), along with the depth=1 argument.

  3. danlawson
    Member
    Posted 5 years ago #

    Thanks for that Michael, Ill look into those links.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags