Support » Plugin: WPtouch » [Plugin: WPtouch] Menu List Sort Order

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author BraveNewCode Inc.

    (@bravenewcode)

    We’re working on addressing this issue, thanks for reporting.

    There’s a simple enough fix for this in version 1.9.6.1.

    Here is a fix and also a way to implement it in the plugin:

    wptouch.php, Line 937: Change the line to:

    $query = "SELECT * from {$table_prefix}posts WHERE ID IN (" . implode(',', $keys) . ") AND post_status = 'publish' ORDER BY menu_order ASC";

    (Replace “ORDER BY ID ASC” with “ORDER BY menu_order ASC”)

    And here’s a way to implement it, if the option was made available on the WPTouch settings page:

    if ( count( $keys ) > 0 ) {
    		if ( isset( $ids['sort-order'] ) && $ids['sort-order'] == 'page' ) {
    			$query = "SELECT * from {$table_prefix}posts WHERE ID IN (" . implode(',', $keys) . ") AND post_status = 'publish' ORDER BY ID ASC";
    		} else if ( isset( $ids['sort-order'] ) && $ids['sort-order'] == 'menu_order' ) {
    			$query = "SELECT * from {$table_prefix}posts WHERE ID IN (" . implode(',', $keys) . ") AND post_status = 'publish' ORDER BY menu_order ASC";
    		} else {
    			$query = "SELECT * from {$table_prefix}posts WHERE ID IN (" . implode(',', $keys) . ") AND post_status = 'publish' ORDER BY post_title ASC";
    		}
    
    		$results = $wpdb->get_results( $query, ARRAY_A );
    	}

    On the settings page, it’s just a matter of adding the extra option.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: WPtouch] Menu List Sort Order’ is closed to new replies.