Support » Fixing WordPress » Change sort order to Menu Order

  • Resolved Patrick


    Hi there,

    I have a function built into a theme that creates a list of subpages using a shortcode. It allows you select ‘ASC’ or ‘DESC’ to choose the sort order. However, is it possible to use menu_order here?

    Thanks in advance

    if ($order == 'ASC' && $parent == true ){
    				if ($current_url==$parent_url){ $extra = "class='current' "; }else{ $extra = null; }
    				$src.= '<li '.$extra.'><a href="'.$parent_permalink.'">'.$parent_title.'</a></li>';
    			while ($wp_query_childs->have_posts()) : $wp_query_childs->the_post();
    				$item_url = str_replace(array('http://', 'https://'),'',strtolower(get_permalink()));
    				if ($current_url==$item_url){
    					$extra = "class='current' ";
    					$extra = null;
    				$src.= '<li '.$extra.'><a href="'.get_permalink().'">'.get_the_title().'</a></li>';
Viewing 2 replies - 1 through 2 (of 2 total)
  • Patrick


    What I mean’t to say waht sort the list by menu_order, rather than ASC or DESC




    All sorted now, just needs to change the “orderby” to ‘menu_order’

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change sort order to Menu Order’ is closed to new replies.