Support » How-To and Troubleshooting » [Resolved] global_nav vs. wp_list_pages

[Resolved] global_nav vs. wp_list_pages

Viewing 5 replies - 1 through 5 (of 5 total)
  • What’s global_nav? I can’t find any trace of it in any WordPress function reference…

    It’s in the sandbox theme. It’s in the header. It seems to serve the same purpose as wp_list_pages.

    From Sandbox’s functions.php:

    // Produces a list of pages in the header without whitespace
    function sandbox_globalnav() {
    	if ( $menu = str_replace( array( "\r", "\n", "\t" ), '', wp_list_pages('title_li=&sort_column=menu_order&echo=0') ) )
    		$menu = '<ul>' . $menu . '</ul>';
    	$menu = '<div id="menu">' . $menu . "</div>\n";
    	echo apply_filters( 'globalnav_menu', $menu ); // Filter to override default globalnav: globalnav_menu

    So in essence, it’s a wrapper for wp_list_pages and the difference is global_nav takes out the whitespace (line returns) in the output

    Thank you.



    Digging a little deeper, how does the sandbox_globalnav function produce a horizontal menu? It is a list and a list is vertical. I would like to produce a menu that is horizontal for my parent pages and vertical for my child pages. I don’t understand how to modify this function to achieve this effect. Any idea how to modify this function to do that? Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] global_nav vs. wp_list_pages’ is closed to new replies.