menu walker dropdown wordpress function

use to template

wp_nav_menu(array( 'theme_location' => 'primary', // your theme location here 'walker' => new Walker_Nav_Menu_Dropdown(), 'items_wrap' => '', ));

function to add

class Walker_Nav_Menu_Dropdown extends Walker_Nav_Menu{ // don't output children opening tag (`
    `) public function start_lvl(&$output, $depth){} // don't output children closing tag public function end_lvl(&$output, $depth){} public function start_el(&$output, $item, $depth, $args){ // add spacing to the title based on the current depth $item->title = str_repeat(" ", $depth * 4) . $item->title; // call the prototype and replace the
  • tag // from the generated markup... parent::start_el(&$output, $item, $depth, $args); $output = str_replace('
  • with the closing option tag public function end_el(&$output, $item, $depth){ $output .= "
\n"; } }  

display all page content on homepage wordpress

<?php
   //$args=array('post_type' => 'page');
   $my_query = new WP_Query( array ('orderby' => 'menu_order', 'posts_per_page' => '5','post_type' => 'page' ));
   //print_r($my_query);
if( $my_query->have_posts() ) {
  while ($my_query->have_posts()) : $my_query->the_post();
   $id = get_the_ID();
   $value    = wp_specialchars( get_post_meta($id, 'class_name', true ));
  ?>
      <div class="<?php echo $value;?>" id="<?php echo $value;?>">
      <?php the_title();?><br>
  <?php the_content(); ?>
  </div>
    <?php
  endwhile;
}
?>