WordPress.org

Ready to get started?Download WordPress

Forums

Adding menu link to list of child pages in side bar on a parent page? (1 post)

  1. Reaxion
    Member
    Posted 2 years ago #

    Hi!

    This code works great to list all the pages of a section (all the child pages)

    <ul>
            		<?php
    					if($post->post_parent == 0)
    					{
    					wp_list_pages("title_li=&child_of=".$post->ID."&show_date=modified&date_format=$date_format&location=sidebar&sort_column=menu_order");
    					}
    					else
    					{
    					wp_list_pages("title_li=&child_of=".$post->post_parent."&show_date=modified&date_format=$date_format&location=sidebar&sort_column=menu_order");
    					}
    					?>
                     </ul>

    But I have one or more selections created in the Menu that are links that show up in drop down menus, but since a selection is not a page it will not show up with the above code which displays child pages of a current section.

    Other than creating a custom menu and adding it to the sidebar, is there any handy dandy code that I can use to generate a page/link list falling under a parent?

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic