php


'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.

Related Links

Sharing complex objects across controller methods Laravel 5.1
Query optimization for laravel pagination
echo selected in chosen select
Yii 1.1x logs out the user before session timeout
PHP Moving an array into different text files?
PHP and Highcharts
insert function and session into database
testing contents of loadHTML($str)
Parse tables using Symfony DomCrawler
Allow user to delete their entries
PHP external API access fails, when called from another page on same domain?
Inserting data from excel into PHP application, don't works
htacess file unable to retrieve authenticated/logged in user when request is ajax
Random quote from file with PHP [duplicate]
How do i clear this array by user input in php/html?
How to detect that a MySQL table has been saved to attach an event?

Categories

HOME
hpoo
opengl
entity-framework
apache-nifi
weblogic12c
vagrant
adfs3.0
dependencies
greasemonkey
flurry
mosquitto
scheduler
selection
port
erd
android-externalstorage
pm2
freertos
sql-injection
max-msp-jitter
adobe-illustrator
opentext
fusetools
tracing
beego
list-comprehension
tortoisehg
bitbake
docx4j
om-next
markov-chains
ng-repeat
gitolite
extbase
praat
system-on-chip
classnotfoundexception
web-inspector
sendinput
swift2.3
roracle
icecast
watir-webdriver
mongodb-aggregation
portability
wikimapia
polymaps
degrees
google-shopping-api
nitrousio
clp
nsrunloop
yii2-model
adp
jeditable
django-redis
wikimedia-commons
webgrind
phpquery
linuxbrew
bjam
google-gdk
physicsjs
mgwt
incron
lifetime
flurry-analytics
visual-studio-6
oracle-adf-mobile
visual-c++-2012
full-text-indexing
lumia-imaging-sdk
box2dweb
xulrunner
jms-serializer
lync-2010
xsd2code
yii-booster
multiscaleimage
gitx
live-wallpaper
workflow-manager-1.x
coordinate
monocross
hardcode
netstream
yuidoc
microblogging
mmc3
servercontrol
nsrangeexception
nosetests
suphp
efs

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App