function start_el(&$output, $item, $depth, $args) { global $wp_query; $indent = ($depth) ? str_repeat("\t", $depth) : ''; $slug = sanitize_title($item->title); //$id = apply_filters('nav_menu_item_id', 'menu-' . $slug, $item, $args); //$id = strlen($id) ? '' . esc_attr( $id ) . '' : ''; $li_attributes = ''; $class_names = $value = ''; $classes = empty($item->classes) ? array() : (array) $item->classes; if (in_array('current_page_parent', $classes)) { $classes[] = 'active'; } if ($args->has_children) { $classes[] = 'dropdown'; $li_attributes .= ' data-dropdown="dropdown"'; } $classes[] = ($item->current) ? 'active' : ''; $classes = array_filter($classes, array(&$this, 'check_current')); $class_names = join(' ', apply_filters('nav_menu_css_class', array_filter($classes), $item)); $class_names = $class_names ? ' class="' . esc_attr($class_names) . '"' : ''; $output .= $indent . '<li' . $class_names . $li_attributes . '>'; $attributes = ! empty($item->attr_title) ? ' title="' . esc_attr($item->attr_title) .'"' : ''; $attributes .= ! empty($item->target) ? ' target="' . esc_attr($item->target ) .'"' : ''; $attributes .= ! empty($item->xfn) ? ' rel="' . esc_attr($item->xfn ) .'"' : ''; $attributes .= ! empty($item->url) ? ' href="' . esc_attr($item->url ) .'"' : ''; $attributes .= ($args->has_children) ? ' class="dropdown-toggle" data-toggle="dropdown"' : ''; $item_output = $args->before; $item_output .= '<a'. $attributes .'>'; $item_output .= '<span class="count">' . romanize($item->menu_order) . '.</span>'; $item_output .= $args->link_before . apply_filters('the_title', $item->title, $item->ID) . $args->link_after; $item_output .= ($args->has_children) ? ' <b class="caret"></b>' : ''; $item_output .= '</a>'; $item_output .= $args->after; $item_output = lowercase_s($item_output); $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args); }
<?php while (have_posts()) { the_post(); ?> <h1><span class="count"><?php echo romanize($post->menu_order); ?> .</span><?php the_title(); ?> </h1> <?php the_content(); }
<?php while (have_posts()) : the_post(); ?> <h1><span class="count"><?php echo romanize($post->menu_order); ?>.</span><?php lowercase_s(the_title()); ?></h1> <?php the_content(); ?> <?php endwhile; ?>
<?php while (have_posts()) : the_post(); //get parent title to display correct sub-page heading $parentID = $post->post_parent; $parent = get_post($parentID); ?> <h1><span class="count"><?php echo romanize($parent->menu_order); ?>.</span><?php echo lowercase_s($parent->post_title); ?></h1> <h2><?php echo lowercase_s(get_the_title()); ?></h2> <?php the_content(); ?> <?php endwhile; ?>