0

With regards to ordering categories on a page or post (in breadcrumbs for example) is there a way of ordering these?

I know that there are plugins but I can't seem to get them to work (I've tried two of them).

Surely Wordpress has another means of doing this?

Thanks for all direction.

0
add_filter( 'get_terms_args', 'wpse_53094_sort_get_terms_args', 10, 2 );
function wpse_53094_sort_get_terms_args( $args, $taxonomies ) 
{
    global $pagenow;
    if( !is_admin() || ('post.php' != $pagenow && 'post-new.php' != $pagenow) ) 
            return $args;

    $args['orderby'] = 'slug';
    $args['order'] = 'DESC';

    return $args;
}
  • wow - thats interesting... So 10, 2 are examples of category ID's right? – henry Aug 24 '17 at 5:10
  • you can refer this link link – DHL17 Aug 24 '17 at 5:14
  • 10 is priority & 2 is accepted arguments – DHL17 Aug 24 '17 at 5:17
  • Accept the answer if u find it useful :) so it will also helpful for others. – DHL17 Jan 9 '18 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.