In this tutorial I will show you how to show the only selected pages in menu. add selected pages in wordpress menu using our code sample. which can be added.
add selected pages in wordpress menu
Normally when we are creating wordpress theme for showing the pages we code as follows
<?php wp_page_menu('show_home=1&menu_class=page-navi&sort_column=menu_order'); ?>
As per this code all pages will get displayed in menu. For showing selected pages check the page id.
and then use following code.
<?php wp_page_menu('show_home=1&include=5,9,23&menu_class=page-navi&sort_column=menu_order'); ?>
You are able to see the I added the include parameter in wordpress method. Your selected page id you need to just put there with comma separated.
Put this code in your header.php file for showing the menu. Only selected pages will be shown on wordpress menu.