'Order by' specified order in Woocommerce shortcode
I am currently using the shortcode: [product_categories ids="135, 214, 244, 1958, 72, 205, 43, 559, 73, 1033, 69, 2009, 1365, 1250, 462, 346, 1649, 1344, 1379, 1373" orderby="id"] to display Woocommerce product categories on a Wordpress site. It works, but I need the categories to be displayed in the order that they're listed in the ids quotations. I know of orderby="name", "date", and "id", and none of those will work for this particular task unless you know of any nifty hacks that involve them. Any Ideas? Thanks
I haven't solved the issue but I'm going to post this work around as an answer in case anyone else is struggling with this. Just re-ordered the sub-categories in the order you want them displayed manually. Do this with the drag-and-drop method in WooCommerce > products > categories. Then in your short-code, write: [product_categories parent="*your parent category id*" ids="*the sub-category ids you want displayed*" hide_empty="0"] This will display your specified sub categories in the order that you put them in with the drag and drop. Note: If you want to hide categories without any products in them remove the 'hide_empty' portion of the short-code. Also when displaying multiple sub categories, remember that the ids are separated by commas. ie: ids="1, 2, 3" If anyone knows the short-code solution please post/comment, because the drag and drop method is very time consuming when you have hundreds of categories.
How to get and display post's “position” in the query?
Unexpected behavior when calling a Ruby script via PHP's shell_exec()
One cookie with many values or many cookies with one value?
Getting Post Information Outside the Wordpress Loop
I want to call a class object, being the class name a given parameter
code effect in html/blog
Symfony 1.4: Programatically set environment for CLI
PHP Call Time Pass Reference
How dangerous is allowing Flash in a blog?
what's wrong with this php code?
php echo include
PEAR's mail queue alternative?
Is PHP PEAR included with php?
Sort array by object property in PHP?
Invert function: base 38 conversion