0

I know this can be done but i've not got a clue how.

Rather than going into wordpress and creating a menu, I simply want to show all the pages that exists.

i.e. If I go into the menu panel and create a new menu, I then add pages 1, 2, 3 and 4, the menu will then show those 4 pages but I actually have 7 pages in wordpress.

So rather than manually adding all 7 pages, I want to show all pages as default

Here's my menu so far

<nav class="indent-right"> 
  <?php
wp_nav_menu(
array (
    'menu'            => 'main-menu',
    'container'       => FALSE,
    'container_id'    => FALSE,
    'menu_class'      => '',
    'menu_id'         => FALSE,
    'depth'           => 1,
    'walker'          => new Description_Walker
)
);
?>
</nav>

Anyone know how?

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.