Support » Plugin: Reorder by Term » Excellent work

  • chickwithbob

    (@chickwithbob)


    Brilliant plugin.

    I had this up and running in 15 minutes.
    Note you will need to adjust your WP_Query functions, but it provides you with the code snippets you need – very handy!

    For example I use the following to provide a custom post sort order by taxonomy:

    $category_name = $post->post_name;
    $args = array(
    ‘post_type’ => ‘project’,
    ‘post_status’ => ‘publish’,
    ‘posts_per_page’ => -1,
    ‘order’ => ‘ASC’,

    //’orderby’ => ‘menu_order’, //old code
    //’category_name’ => $category_name //old code

    //New sort order by term:
    ‘meta_key’ => ‘_reorder_term_category_’.$category_name,
    ‘orderby’ => ‘meta_value_num title’

    );
    $projects = new WP_Query($args);

    A gotcha is to ensure you have “Sort by” set to None for the menu order arguments found within Settings – Reorder Posts, otherwise it will ignore the custom sort order.

  • The topic ‘Excellent work’ is closed to new replies.