Limit the Number of Pages in Your Wordpress Navigation Bar

  • 14 years ago
Using the “include” function in Wordpress you can specify the exact number of pages you want to show in your navigation. Example: Show traffic is gold. You need to edit the header.php file found here: wp-content/themes/your-theme/header.php Open the file with your favorite editor. Search the file for “wp_list_pages” Find This: php wp_list_pages('title_li=&depth=4&sort_column=menu_order); Change to this: php wp_list_pages('title_li=&depth=4&sort_column=menu_order&include=2,7,6,112,5'); Upload the file and your site should only show the pages you’ve indicated.