WordPress.org

Ready to get started?Download WordPress

Plugin Directory

!This plugin hasn't been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

postMash (filtered) - custom post order

Customise the order your posts are display in using this simple drag-and-drop Ajax interface, tweaked to allow admin sorting by category/date.

To make use of this chosen order you will need to modify your template code: Open wp-content/themes/your-theme-name/index.php and find the beginning of ‘the loop’. Which will start: if(have_posts()). Then add the following code directly before this:

<?php  
    $wp_query->set('orderby', 'menu_order');  
    $wp_query->set('order', 'ASC');  
    $wp_query->get_posts();  
?>

This just tells WP to get the posts ordered according to their ‘menu_order’ position. Therefore you can get the posts ordered anytime you use a function such as get_posts simply by giving it the required arguments:

<?php get_posts('orderby=menu_order&order=ASC'); ?>

Checkout the get_posts() function in the wordpress codex for more info. Note that it says menu_order is only useful for pages, posts have a menu_order position too, it just isn’t used. postMash provides you with an iterface so that you can use it.

NEXT POST AND PREVIOUS POST LINKS

ALSO You can now use the 'Next Post' and 'Previous Post' calls in your template file 'single.php', as usual, but rather than calling items by date, it will call items using the same order as set in postMash, using the following modified commands in place of the regular tags

ORIGINAL TAGS

    next_post_link(); 
    previous_post_link();

MODIFIED TAGS

    next_post_link_menu(); 
    previous_post_link_menu();

(Please note that, by default, 'In Same Category' is set to TRUE. You will need to edit this if you wish to disable it. All other variables passed to the function should work as normal)

OPTIONAL ADMIN INSTALLATION

If you wish to view the posts in the WordPress admin 'Edit Posts' panel in the same order as you have set them postMash (rather than the default 'Date Published' or 'Date Modified'), you can modify wp-admin/includes/post.php, on line 784 as follows;

ORIGINAL

    if ( isset($q['post_status']) && 'pending' === $q['post_status'] ) {
        $order = 'ASC';
        $orderby = 'modified';
    } elseif ( isset($q['post_status']) && 'draft' === $q['post_status'] ) {
        $order = 'DESC';
        $orderby = 'modified';
    } else {
        $order = 'DESC';
        $orderby = 'date';
    }


MODIFIED

    if ( isset($q['post_status']) && 'pending' === $q['post_status'] ) {
        $order = 'ASC';
        $orderby = 'menu_order';
    } elseif ( isset($q['post_status']) && 'draft' === $q['post_status'] ) {
        $order = 'ASC';
        $orderby = 'menu_order';
    } else {
        $order = 'ASC';
        $orderby = 'menu_order';
    }

Requires: 2.1 or higher
Compatible up to: 2.8
Last Updated: 2009-6-21
Downloads: 19,864

Ratings

3 stars
3.8 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1
100,2,2
100,1,1
100,2,2
100,3,3
100,2,2
88,8,7
50,2,1
50,4,2
100,1,1
0,2,0
0,2,0
100,1,1
0,1,0