WordPress.org

Ready to get started?Download WordPress

Forums

Arconix FAQ
orderby menu_order (7 posts)

  1. globaltimoto
    Member
    Posted 7 months ago #

    Great plugin !

    I wanted to do an orderby menu_order, but the Faq pages do not have an order field as typical Pages do.

    Is there another way to do this or might this field be added in future ?

    http://wordpress.org/plugins/arconix-faq/

  2. globaltimoto
    Member
    Posted 7 months ago #

    Perhaps I should clarify.

    As far as I can see, without being able to edit an order field for each faq question it is not possible to create an arbitrary menu order independent of date, name etc.

    Currently the only way I can see of taking control of the order is by adding a number at the beginning of each faq question eg 01, 02, 03 etc.

    Is that true, or am I missing something ?

  3. John Gardner
    Member
    Plugin Author

    Posted 7 months ago #

    Hi globaltimoto,

    Thanks for using my plugin and for the kind words. Currently there is no built-in support for menu_order however it can be added with just a couple lines to your theme's functions.php file.

    add_filter( 'arconix_faq_defaults', 'my_faq_defaults' );
    function my_faq_defaults( $defaults ) {
    	$defaults['post_type']['args']['supports'][] = 'page-attributes';
    
    	return $defaults;
    }

    Then you can use the orderby menu_order. Just make sure order to ASC.

  4. globaltimoto
    Member
    Posted 7 months ago #

    Hi John

    Thank you, that works.

    I can now edit the order in the admin faq listing and do this:

    [faq group="name" orderby="menu_order"]

    Which appears to give me the expected order.

    Would be nice to now sort by menu_order in the admin faq listing.

  5. codeyear
    Member
    Posted 5 months ago #

    Hi,
    I editted the functions.php file with your above code to sort FAQ questions in a specified order, for example I dont want to the posts to be in alphabetical order.
    I want to specify the order of which questions are displayed eg What is x? Can I buy X?
    When in alphabetical order, the order of which questions are displayed would be reversed.

    I added the above filter under functions, I get the attribute field in each of the questions. However I cannot get the Questions to be displayed in order on the front end.

    I have tried to use [faq group="name" orderby="menu_order"], this shows a blank page.

    When I used [faq], this display the questions. But these arent in the right order.

  6. John Gardner
    Member
    Plugin Author

    Posted 5 months ago #

    Hi codeyear,

    That is quite the issue you have. I have to do a little investigation on that. I'm not sure how WordPress handles menu-order when dealing with taxonomies, or if it can even order them in a manner we could expect. I'll update the thread once I've done a bit of research and testing.

  7. John Gardner
    Member
    Plugin Author

    Posted 4 months ago #

    Sorry it's been so long since I updated this thread. I tested this in a local development environment and I didn't have any issues setting and sorting by the menu order, even across taxonomies. I'm not entirely certain, codeyear, why you were getting a blank page, though I have seen odd issues when the group name was being used and not the group slug.

Reply

You must log in to post.

About this Plugin

About this Topic