orderby menu_order
-
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 ?
-
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 ?
Hi globaltimoto,
Thanks for using my plugin and for the kind words. Currently there is no built-in support for
menu_orderhowever it can be added with just a couple lines to your theme’sfunctions.phpfile.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 sureorderto ASC.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.
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.
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-orderwhen 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.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.
The topic ‘orderby menu_order’ is closed to new replies.