Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //In ul write the code of bellow
- <ul class="nav navbar-nav">
- <?php
- global $post;
- $args = array(
- 'post_type' => 'page',
- 'orderby' => 'menu_order',
- 'posts_per_page' => -1,
- 'order' => 'ASC'
- );
- $myposts = get_posts( $args );
- foreach ( $myposts as $post ) : setup_postdata( $post ); ?>
- <li><a class="page-scroll" href="#<?php echo $post->post_name; ?>"><?php the_title(); ?></a></li>
- <?php endforeach; ?>
- </ul>
- // Note that; Create the page including order like Home, order 1, About order 2, Services order 3 etc.
- // No need the register function for menu dynamic in this case.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement