w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Create a default wordpress menu with all pages without actually creating one in the menu panel

Use the following to invoke the menu:

<?php wp_page_menu( $args ); ?>

Change the args as needed:

<?php $args = array(
    'depth'       => 0,
    'sort_column' => 'menu_order, post_title',
    'menu_class'  => 'menu',
    'include'     => '',
    'exclude'     => '',
    'echo'        => true,
    'show_home'   => false,
    'link_before' => '',
    'link_after'  => '' );
?>

By default, all pages will be shown. Read more here.





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.