Q&A plugin: How to adjust the catagory display order

I have a site segmented in modules and lessons. In need to display the categories according to there lesson order. Right now they are out of order.

How would I change the order the categories are being displayed in the submit question drop-down menu?

Thanks

  • magi
    • Design Lord, Child of Thor

    Alot of hacking of the code here to get something pretty simple done...

    I've opened the widgets.php for the Q&A plugin...

    Here's what I'm seeing...

    $cat_args = apply_filters( 'qa_category_widget_args', $cat_args, $instance );

    echo '

      ';
      wp_list_categories( $cat_args );
      echo '
    ';

    echo $after_widget;

    We need more then just alphabetical sorting control. We need to be able to put the categories in their linear order according to the structure of the training modules.

    Can this be done?

  • Hakan
    • The Incredible Smush

    Hi,

    The sample you have given is for the category widget and it is already sorted by name.

    You are actually asking sort order during submitting a question. However it uses this function and it is also sorted by name:
    http://codex.wordpress.org/Function_Reference/wp_get_object_terms

    So you ask a custom order, is that right?

    This is not possible at the moment. I will add a filter in the future where you can change as you wish.

    Or you may consider hiring a developer to modify it for you:
    https://premium.wpmudev.org/wpmu-jobs/

    You or he can assume that this will be the filter in template-tags.php in the next release:

    $args = apply_filters( 'qa_category_args', array( 'fields' => 'ids' ) );
    $cats = wp_get_object_terms( $question->ID, 'question_category', $args );

    Cheers,
    Hakan

  • Tom Eagles
    • Syntax Hero

    Hiya, just going through some of the older threads here.

    As it's been a little while since we last heard from you I thought I'd check in to see how you're going?

    If you're still looking for some further assistance with this thread then please feel free to reopen the thread or of course for any new and related issues you are most welcome to open a new thread.

    Cheers!
    Tom

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.