pods_navigation

(Since 1.2.0) -- return an HTML menu structure using build_nav_array
function pods_navigation($uri = '<root>', $max_depth = 1)
This function generates an HTML menu structure. It uses the build_nav_array function to retrieve an array of menu items from the Menu Editor.

Parameters

ParameterTypeDetails
$uri STRING The URI to use as a starting point. Default = <root>
$max_depth INT (optional) the maximum number of levels to traverse. default = 1, unlimited = 0

Returns

String

Examples

<?php
// Display items from Home up to 1 level deep
echo pods_navigation();
 
// Same as above (top level navigation)
echo pods_navigation('<root>', 1);
 
// Display the entire menu structure
echo pods_navigation('<root>', 0);
 
// Display the "/about/" page and everything in it
echo pods_navigation('about', 0);
 
// Display the "/about/" page and up to 3 levels deep
echo pods_navigation('about', 3);
?>
See Also