WordPress.org

Ready to get started?Download WordPress

Forums

WPtouch Mobile Plugin
[Plugin: WPtouch] Menu List Sort Order (3 posts)

  1. rogrdat
    Member
    Posted 1 year ago #

    I love this theme but it's very difficult to keep my pages in the correct order. It would be great if the Menu List Sort Order option could use the page order field as well as the Page Name or Page ID.

    http://wordpress.org/extend/plugins/wptouch/

  2. BraveNewCode Inc.
    Member
    Plugin Author

    Posted 1 year ago #

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

  3. julianm
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic