WordPress Dropdown of Child Pages
A friend of our across at About a Ball wanted to know if there was a way of adding code to a WordPress page template to list child pages in a dropdown list which when selected would take the user to the selected child page. Well… here it is;
<form action="/" method='get'>
ID;
$children = wp_dropdown_pages("child_of=$parent_id&echo=0");
$select = preg_replace("#]*)>#", "", $children);
echo $select;
?>
Tags: wordpress
Leave a Reply