postMash

postMash is another WordPress plugin I’ve written very similar to a previous plugin of mine; (pageMash). However it is a fair bit simpler since posts have no parenting structure, the ordering is only linear.

Posts are usually listed in reverse chronological order as they are often used for posting regular time-orientated content, however if you want to choose the order they appear in, then this is the plugin for you.

Usage

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.

downloadDownload
Last updated: 2009-3-5
Total downloads: 3,694
Stable: v1.1.0

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

Recent posts on postMash





78 comments

78 Responses to “postMash”

  1. No replies Ray:
    @Reply December 27th, 2008 at 6:43 pm

    Where exactly do you put the code for your postmash plugin? Which file do I insert the code snippet in?

  2. No replies Joel:
    @Reply December 29th, 2008 at 9:40 pm

    @Ray:
    It depends on the intended use, and how your template is structured.
    You most likely want to put it in your index.php or sidebar.php files in your template, but you do need to know what you’re doing.
    The above code is a function and therefore requires a call to actually execute it, such as:
    <?php wp_cat_posts() ?>
    It also only outputs a simple link so you may need to develop the code further to fit your requirements.

    Edit: above code is different now, should hopefully be fairly straight forward.

  3. No replies Kathy:
    @Reply February 13th, 2009 at 3:32 am

    Wondering if this is compatible with 2.7. I would love to try it. I’m looking for a really sensible solution.

    thanks!

    kathy

  4. No replies Joel:
    @Reply February 13th, 2009 at 11:14 am

    @Kathy: Yep, should work fine with WP2.7 and I’d be interested to know what you think of postMash.

  5. No replies John:
    @Reply February 18th, 2009 at 11:01 pm

    When will you add a category selection on postmash so people can select the category of the posts they want to order instead of having all them mixed up ?
    Postmash is a life saver. Thanks for this plugin

  6. No replies madeline:
    @Reply February 21st, 2009 at 1:30 am

    Hi! thanks so much for your postMash plugin! I’ve setup my sidebar to display only one category of posts (calendar posts or “category 3″), and trying to figure out where to paste the postMash code in this. It looks like this :

    <a href=”">

    Thanks! M

  7. No replies madeline:
    @Reply February 21st, 2009 at 1:31 am

    oops – code wouldnt show up, and im having trouble emailing it through your Contact page. any way to get yr email address? thx! M

  8. No replies Tim:
    @Reply February 25th, 2009 at 2:39 am

    Great work! I’d love to have a CategoryMash! Thanks for your efforts :)

  9. No replies Ashish Jha:
    @Reply March 5th, 2009 at 5:00 am

    Just wanted to know one thing. i think postmash changes the id of the posts to arrange it. if this is so, there are many meta data and custom configurations which are attched to that post id , does that gets changed too.

  10. No replies Joel:
    @Reply March 5th, 2009 at 8:04 pm

    no postmash doesn’t change the ID’s of the posts it just gives it a order value. Therefore all meta data will stay perfectly intact.

  11. No replies Joel:
    @Reply March 5th, 2009 at 9:22 pm

    @madeline: I sent you an email, but got no reply. Use a pastebin such as codepad.org if you’re having trouble pasting code.

  12. No replies Concorsi a Premi:
    @Reply March 5th, 2009 at 10:12 pm

    Hello everyone, I solved a problem of WP 2.7.1 is running without having to modify the code of WP; Just insert the following code in our templates in use in category.php or index.php

    <?php
    query_posts($query_string . "&orderby=menu_order&order=ASC");
    ?>

    before the code:

    <?php if (have_posts()) : ?>

    I hope work for you too
    Regards
    Stefano

  13. No replies Joel:
    @Reply March 5th, 2009 at 10:21 pm

    @Concorsi a Premi: You shouldn’t ever have needed to modify any core WP code, but what you’ve got there is spot on.

  14. No replies Ashish Jha:
    @Reply March 6th, 2009 at 1:22 am

    Joel the pluigin is perfect, and i see this has been updated but not sure whats the changes.

    would to like to shed some light.

  15. No replies Joel:
    @Reply March 6th, 2009 at 1:29 am

    I moved it’s position in the menu for WP2.7 to be under posts instead of tools, as I thought that would be a more apropriate place.
    Quite a few people had emailed me saying that couldn’t work out what code they were supposed to be changing, so I’ve rewritten most of the install page on the readme to match my updates to this page. Hopefully most people should be able to follow the new instructions without too much trouble.
    But you’re right, no major functional changes.

  16. No replies ahmed:
    @Reply March 7th, 2009 at 9:57 pm

    thans for all

  17. No replies Phil Owens:
    @Reply March 10th, 2009 at 6:11 pm

    Fantastic plugin, just what I was looking for. I’m using it on 2.7.1. Just a word of warning, once installed it makes all your private posts public.

    Thanks

  18. No replies Jason FB:
    @Reply March 10th, 2009 at 9:27 pm

    Note that in the theme called “ultralight” (this might apply to other themes too) there is no line in index.php that begins if have_posts(). Therefore the $wp_query->set does not seems to work right.

    Instead, I was able to get it to work by adding “&orderby=menu_order&order=ASC” to the query_posts() function called in the index (my complete query_posts function looks like this… note that “showposts=10&paged=$paged” was already there….)

    <?php query_posts(“showposts=10&paged=$paged&orderby=menu_order&order=ASC”);

    Cheers.

  19. No replies marie:
    @Reply March 11th, 2009 at 5:17 pm

    Hi,

    First of all thanks a lot for this plugin.
    I did try it and noticed something : it is actually modifying the permalink.
    Did I did something wrong?

    Thanks a lot,
    Marie

  20. No replies Joel:
    @Reply March 11th, 2009 at 6:10 pm

    @Phil Owens: hmm I’m not sure why that would happen, I’ll have to test that out.

    @Jason FB: Yep the instructs won’t work for all themes, but if you know what you’re doing it should always be pretty stratight forward. Hopefully the example code gives you an idea of what to do if you can’t follow it exactly. What you’ve done there is spot on.

    @marie: That shouldn’t happen in postMash as all it does is set an order value. Are you sure you don’t mean pageMash? As that may in-directly cause your permalinks to change when you change the parenting structure.

  21. No replies Collin Kelly:
    @Reply March 12th, 2009 at 12:42 am

    Just a heads up, looks liek the “Show further info” link inside the admin page that tells you how use the plug-in (i.e. pasting php code into index.php just before “the loop”) DOES NOT MATCH what you have here (the code in the admin has an unordered list and list items). Hope you can fix that… confused me till i cam here to see what you actually had works!

  22. No replies Joel:
    @Reply March 16th, 2009 at 10:39 pm

    @Collin Kelly: thanks Collin, I forgot to change that. The code in the ‘further info’ section isn’t wrong by any means, but it is meant as an example rather than code to be copied dirctly into your template.
    Whereas the instructions I have on this page and in the readme file and on wordpress.org should be easier to follow for people with less WP experience.

  23. No replies sam:
    @Reply March 18th, 2009 at 12:38 pm

    +1 vote for a ‘categoryMash’ plugin. seriously. it would be good!
    thanks again for this

  24. No replies Chris Connolly:
    @Reply March 19th, 2009 at 9:53 am

    The plug in works fine with my posts but when i try to open a private page i get “Sorry, no posts matched your criteria. Comments are closed. ”

    If I change the pages to public the are fine.
    If i change them back to private they are fine while I am logged in to wp but as soon as i log out and try to access the private pages the error message re-occurs. Any suggestions?

  25. No replies Sven:
    @Reply March 19th, 2009 at 12:58 pm

    Dear Joel,

    Thanks for this cool plugin !!! For some reason it doesn’t seem to work for me, unfortunately. The Plugin is installed correctly, I can move my post in the admin panel, but it doesn’t affect the post order. When I insert the code into my index.php right before “The Loop” my blog gets completely blank. When I delete the <?php tags my blog works again, but it doesn’t change the posts order.

  26. No replies Joel:
    @Reply March 19th, 2009 at 1:11 pm

    @sam: categories don’t have a sort_order property so to achieve a similar affect would require a more ‘hands on’ approach and would be more complicated to make, but I might think about giving it a go in the future if there is enough demand for it.

    @Chris Connolly: hmm, no, not sure on that one..

    @Sven: sounds like the problem’s with coding postMash into your template rather than the plugin itself. Since templates all vary, the suggested code is not ‘foolproof’ and might need you to do a bit of work to get it to run with your template. Having said that it shouldn’t ever be particularly difficult, but may need you to use some intuition and a bit of research in the codex ;)

  27. No replies Chris Connolly:
    @Reply March 19th, 2009 at 7:04 pm

    I deactivated the plugin and discovered that the problem remained until I removed coding about the menu_order which I inserted directly before the

    if (have_posts()) loop

    Does that help figure out the problem. I have WP2.7.1 and have the Inove theme.

  28. No replies Chris Connolly:
    @Reply March 19th, 2009 at 9:30 pm

    @Chris Connolly:
    Fixed the problem. I changed all the private pages to public and downloaded Pagemash. I used the hide feature of pagemash instead of the private feature on WP pages and it all works.

  29. No replies sam:
    @Reply March 21st, 2009 at 8:55 pm

    re CategoryMash
    i dont know about sort order, but i know categories have heirarchies of parents and childs. if you could make some drag/drop interface like the amazing pageMash where we could just organise the heirarchies of categories that would totally complete the set!
    thanks!

  30. No replies Joel:
    @Reply March 23rd, 2009 at 10:55 am

    @sam: yeah just allowing structuring of the categories heirarchy wouldn’t be too tricky. Maybe one day.. unless you want to have a go at it yourself?

  31. No replies sam:
    @Reply March 23rd, 2009 at 1:45 pm

    would love to, but thats quite beyond me unfortunatley :)

  32. No replies Lois:
    @Reply March 25th, 2009 at 9:29 pm

    Still nothing. I’ve tried adding the codes posted here and on WP, to my index.php file and the sidebar remains the same no matter what. I’m dragging the posts into place in the admin, and nothing is changing. Any thoughts?

  33. No replies Joel:
    @Reply March 25th, 2009 at 9:52 pm

    @Lois: If you want to change the order posts appear in your sidebar, you’ll need to modify the code in your sidebar.. Same idea as when you’re modifying the index file, you need to get the posts in ‘menu_order’.

  34. No replies NameRonald:
    @Reply March 26th, 2009 at 7:56 pm

    I manage a Joomla site and wanted to move it to WordPress but needed two very important thing and PostMash is one. Nice job!
    The other is a plugin to unpost by date. I need to be able to remove posts too. Joomla does both well but leaves much in other places.
    Can’t beleive someone has not come up with and unpost by future date plugin.

  35. No replies Marc:
    @Reply March 27th, 2009 at 11:18 am

    This is almost exactly something I need. I think you need the ability to see the categories with a +/- and can open the one(s) you want to work in and drag posts in the category or between them similar to look of Pagemash but I may have 50 posts in one category, minimizing all other categories would keep the page from being too long.

    I also have a need to use a post in multiple categories and the order in each may be different. I have an events site so I want to have categories for certain geographic areas and by time so an event may be in a certain city’s category as well as June 09 category.

  36. No replies rodrigo:
    @Reply April 3rd, 2009 at 2:28 pm

    Hi,

    I´m trying to include your plugin over ClassiPress theme…. with no results…

    I´ve inserted ” and it seems to work because the order is now ASC, but no way to keep the order selected using postmash ordering…

    any help ??

    thanks

  37. No replies Steve:
    @Reply April 8th, 2009 at 1:48 pm

    I am working on a newspaper type site, where all the news is listed in categories… eg: featured,sports,local etc. I am wondering about if its possible to list the posts under their categories – so have all featured catgory posts listed, then all sports, etc…
    what do you think?

  38. No replies sand:
    @Reply April 9th, 2009 at 1:17 pm

    So good it is!
    It works as good as your amazing pageMash! :-)

  39. No replies Dave:
    @Reply April 18th, 2009 at 7:10 pm

    Another vote for some type of sorting posts grouped / displayed by category. Perhaps an interface similar to http://geekyweekly.com/mypageorder which has a drop down menu to select the category then the posts in that category appear?

    Thanks!

  40. No replies Joel:
    @Reply April 19th, 2009 at 8:50 am

    @Marc, @Steve, @Dave: The only problem is that posts can only have one ‘menu_order’ value, so if you have a post in more than one category then each time you rearrange one category it will lose it’s position within the other category.
    However it seems quite a few people are after this feature so maybe I’ll add it in as an optional feature and leave it down to the user to ensure they only assign a post to one category.

    @rodrigo: not sure.. maybe you could email me or post the relevant code from your template.

    @sand: thanks.

  41. No replies Selwyn Nogood:
    @Reply April 20th, 2009 at 12:18 am

    @Dave: @John: @Joel: @sam: I have just uploaded to the WordPress Plugin Directory a tweaked version of this plugin (postMash Filtered) which now allows you to sort all the posts in the postMash admin panel by Date and Category.

    I have also added a function so you can call ‘Next Post’ and ‘Previous Post’ links in your template ‘single.php’ file in an order which matches the order set in postMash (currently only pulls them in date order, so it doesn’t match your new post reorder)

    And i’ve included instructions on how to modify the admin files, so you can view posts in the main WordPress ‘Edit Posts’ pages in the same order as you set them in postMash.

    I think this plugin is great, but I needed to make these slight changes to simplify things for content editors on one of my websites. I hope the modifications are helpful!

    Cheers,
    Selwyn

  42. No replies Starting from Scratch! | My Dezign:
    @Reply April 23rd, 2009 at 12:49 pm

    [...] postMash by Joel Starnes [...]

  43. No replies dains:
    @Reply May 3rd, 2009 at 7:37 pm

    @Joel: Another vote for arranging posts within categories! maybe building the post menu order number by starting with the category number? e.g. post 3 in category 3 has menu order 33?
    Then all you need is to show each category in your interface and allow us to drag and drop. Maybe we could even drag and drop from one category to the other hmmmm :)

  44. No replies betzy:
    @Reply May 4th, 2009 at 4:07 pm

    ok after instalation and after i modified my index.php i get ” ERROR: UPDATE TIMEUOT ” … what next :( (((

  45. No replies Josh:
    @Reply May 13th, 2009 at 7:35 pm

    Wow – along with Selwyn Nogood’s additions this is ALMOST exactly what I’ve been dyin’ for. Have you guys thought about allowing the users to create different menus?

    This way a user can have:
    get_posts('orderby=menu_order('home-page-menu');
    get_posts('orderby=menu_order('tag-archive-page-menu');

    Also a filter based on tags (or a tag list a user can specify) would be awesome as well.

    Thanks again, and if I come up with a hack to get these ideas manifested I’ll be sure to post.

  46. No replies Josh:
    @Reply May 13th, 2009 at 7:49 pm

    Dang. Sorry — just go ahead and delete my posts. This was already discussed. Sorry for the comments noise!

  47. No replies Jon:
    @Reply May 14th, 2009 at 7:12 am

    Could you please tell me how to edit my index.php to work, I have tried and get it to work, yet also get a broken site as my right sidebar does not render after edit…

    Featured Businesses

    <a href="">ID, 'thumbnail', 'alt="' . $post->post_title . '"'); ?>
    <a href="" class="title">
    post_content, 250); ?>
    <a class="more" href="">more

     

  48. No replies Jon:
    @Reply May 14th, 2009 at 7:17 am

    edit; solved – thx to: Concorsi a Premi:

  49. No replies rool:
    @Reply May 20th, 2009 at 7:47 am

    Hi,
    Thank you for this pluging. It works but when I want to filter it says:
    Sorry, there is nothing for this month!

    Show|Hide Further Info
    How to Use

    In order to make use of postMash, you need to order your posts by “menu_order”. Like this…

    Code:
    ´

    ´
    —–
    I changed it …
    Any suggest?

  50. No replies Sam:
    @Reply May 29th, 2009 at 7:46 pm

    hi Selwyn
    wow, the postMash filtered plugin looks AMAZING, exaclty what I (and probably tonnes of other people) need!! but for me its not working in WP 2.7.1
    no matter what i do, it just says:
    Sorry, there is nothing for this month!

    it might also be of interest that the “How to Use” content is displayed by default, and also the “Show|Hide Further Info” doesnt do anything. Also the “Update” button doesnt do anything either.

    looking forward to a working version!

    Thanks so much

  51. No replies Sam:
    @Reply May 29th, 2009 at 7:51 pm

    @Sam:
    maybe Joel can remod this back into something that works? :)
    please…

  52. No replies Ryan:
    @Reply June 9th, 2009 at 1:30 pm

    where do i put what code:

    this is my code in my index.php file:

    <
    <div class=”">

    <a href=”">

  53. No replies holling:
    @Reply June 9th, 2009 at 11:20 pm

    Any progress on the filtering fix? Perfect choice for my client, who has ~600+ posts to filter by category, but painful otherwise. Thanks!!

    b

  54. No replies Gianfranco:
    @Reply June 10th, 2009 at 12:05 pm

    Hi, same proble as Sam.
    I thought this plugin was exactly what I needed to manually order posts of a particular category (really need that feature in my theme), but it just doen’t work at all.

    When I select a category, it says: Sorry, there is nothing for this month!

    Such a pity…

  55. No replies Suggested plugins | Framework:
    @Reply June 10th, 2009 at 12:45 pm

    [...] postMash does a simple but very important thingy, allows you to order all the arcticles! You can’t live without. Installing it is not enough, after is needed a little modification to the code. details and download [...]

  56. No replies John:
    @Reply June 10th, 2009 at 10:00 pm

    tested on two 2.7.1 wp sites and the filtering function is not working. This plugin would really rock if that worked.

  57. No replies John:
    @Reply June 10th, 2009 at 10:19 pm

    @John: Im sorry, commented this on the wrong place. Joel didn’t write the filtered version, I got confused. You can delete both of them :/

  58. No replies Morten Skogly:
    @Reply June 15th, 2009 at 9:46 am

    Sweet! Does anyone know which changes to make to get the same order on the rss? (Preferably by using a plugin, not haching the wp_rss.php scripts)

  59. No replies Roger:
    @Reply June 15th, 2009 at 11:58 am

    I am a beginner using revolution chrome template, already pasted;
    set(‘orderby’, ‘menu_order’);
    $wp_query->set(‘order’, ‘ASC’);
    $wp_query->get_posts();
    ?>
    into index.php but don’t know what to do with;

    I can use postmash in admin but no change on site, just not sure where to use last part of code, already tried template.php, singlepost.php

    Appreciate help and education ?!?

  60. No replies Selwyn Nogood:
    @Reply June 17th, 2009 at 7:11 am

    @Sam:
    @Gianfranco: I have uploaded version 1.2 which should hopefully resolve the bug you’ve found. thanks for the feedback!

  61. No replies Toby:
    @Reply June 17th, 2009 at 8:43 am

    Had probs getting this working but then found the code stefano commented:

    Dont think I found this on the wordpress plugin page, installtion section – could maybe do with an update.

    Excellent plugin thanks very much.

  62. No replies Post Mash Filtered « Post Mash Filtered:
    @Reply June 19th, 2009 at 7:25 pm

    [...] postMash Filtered is a simple tweak of another WordPress plugin written by Joel Starnes, postMash. However, the admin panel has been modified to allow you to filter posts by Category and Date, [...]

  63. No replies JonR:
    @Reply June 22nd, 2009 at 5:53 pm

    Will there be an update for WordPress 28?

  64. No replies Kim:
    @Reply June 30th, 2009 at 4:09 am

    How do you get this to work in v. 2.8? The index page is totally different and doesn’t have the code referenced. I really appreciate someone’s help.

  65. No replies Gianfranco:
    @Reply July 19th, 2009 at 5:47 pm

    Ok, cool, I’ll check it out. Thank you!

  66. No replies Wordpress postMash Widget | DansNetwork.com:
    @Reply July 21st, 2009 at 9:58 pm

    [...] really like the postMash plugin for WordPress. It allows you to drag and drop your posts into any order. This is great when [...]

  67. No replies WORDPRESS SUGGESTED PLUGINS | framework:
    @Reply July 22nd, 2009 at 10:44 am

    [...] It does a simple but very important thingy, allows you to order all the arcticles! You can’t live without. Installing it is not enough, after is needed a little modification to the code. details and download [...]

  68. No replies Craig:
    @Reply July 22nd, 2009 at 11:11 pm

    Joel – excellent plugin. Is it possible to assign different style classes to different posts using PostMash? I’ve got 9 posts i want to show, 6 with 1 style class and 3 with a different style class.

    Cheers, Craig

  69. No replies Meagan:
    @Reply July 23rd, 2009 at 9:45 pm

    Hi, Joel. I have inserted the code into the appropriate area in my main index file template with Studio Press Allure. Still, I am unable to rearrange my post order. My code now looks like this:
    set(‘orderby’, ‘menu_order’);
    $wp_query->set(‘order’, ‘ASC’);
    $wp_query->get_posts();
    ?>

    Am I doing something wrong, or do I need to execute a call somewhere? If so, where does this call need to be put?

  70. No replies Timothy:
    @Reply July 24th, 2009 at 3:31 pm

    The instructions are a bit confusing on how they are worded. You want to put the first bit of code right before if(have_posts()) and then the last bit right after. So it would look like:
    set('orderby', 'menu_order');
    $wp_query->set('order', 'ASC');
    $wp_query->get_posts();
    ?>


    At least this worked for me using WP 2.8.2

  71. No replies Giri Fox:
    @Reply July 28th, 2009 at 4:42 pm

    Hi mate, you said you have uploaded a new v1.2, but wordpress.org is not providing that; it still downloads v1.1

  72. No replies phpworker:
    @Reply July 29th, 2009 at 9:43 am

    @Concorsi a Premi:

    Thanks for sharing, this tip really helped me out :)

    BTW, great plugin. Is there any way to integrate such functionality with core Admin Posts Page?

    Cheers!

  73. No replies phpworker:
    @Reply July 29th, 2009 at 9:44 am

    … and IT WORKS on WP 2.8.2 :D

  74. No replies Renjith:
    @Reply August 11th, 2009 at 11:18 am

    @Jeol:
    Can we use the posts_orderby filter inside the plugin so that ordering takes effect right through the site without needing to make any changes in theme code?

    add_filter('posts_orderby', 'postMash_orderPosts');


    function postMash_orderPosts($orderBy) {
    global $wpdb;
    $orderBy = "{$wpdb->posts}.menu_order ASC";
    return($orderBy);
    }

  75. No replies Giovanni ~ Quacos:
    @Reply May 3rd, 2011 at 7:51 am

    This is a very nice plugin that fills partly the gap between WordPress and the concept of CMS, an update would be very appreciated, because it seems that drafts and trashed articles are displayed on the site….

  76. No replies JD:
    @Reply July 21st, 2011 at 4:13 pm

    Hey guys, I am a total novice when it comes to PHP so forgive me if this has been already asked and answered. When I activate PostMash it reorders my posts from oldest to newest by default. Is there a way to have it keep the current newest to oldest and then allow me to reorder from there? Thanks for the great plugin and work.

  77. No replies Matt:
    @Reply August 15th, 2011 at 8:55 am

    Thanks for this plugin. It seems though the previous/next links in posts are not consistent with the plugins order. Is there a way to achieve this?

  78. No replies Kidney Stone Pain Center:
    @Reply September 13th, 2011 at 10:04 am

    Hi Joel
    Found your postMash plugin in the WP repository. Great plugin does exactly what I want to reorder my posts. Thanks for all the hard work.



Leave a Reply

XHTML» permissible tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>