• baldidiot

    (@baldidiot)


    I’m trying to set up a shortcode that uses two sets of fields for the order – the reference guide says this is possible but it’s not working.

    Two fields we want to order by:

    1. Radio button with options 1, 2 and 3
    2. Date

    This is what I’m using but it’s not outputting any posts. If I remove the orderbey_2 it works fine:

    orderby=field key=positioning order=desc orderby_2=date order_2=desc

Viewing 4 replies - 1 through 4 (of 4 total)
  • Peter Berger

    (@peterpolow)

    Try to define key_2 and change orderby_2=date to orderby_2=field_num.

    May be you also need field_num for “positionering”?

    Peter

    Thread Starter baldidiot

    (@baldidiot)

    Thanks for the reply Peter.

    Still doesn’t seem to be working – this is what I’m currently using:

    [loop type=myposts orderby=field_num key=positioning order=desc orderby_2=field_num key_2=date order_2=desc]

    It works as expected without the second parameter and also fine when only using the date parameter. It’s just combining them that doesn’t seem to be working.

    • This reply was modified 6 years ago by baldidiot.

    Hi – did you ever get to the bottom of this problem?

    I am also having the same issue:

    [loop type=external_link taxonomy=page_location term={PAGE} orderby=sort_order orderby_2=title]

    Either sort_order or title works fine with the orderby but adding the orderby_2 stops it working.

    Any help would be much appreciated!

    Thanks

    Sheila

    • This reply was modified 5 years, 9 months ago by sheila888.
    Thread Starter baldidiot

    (@baldidiot)

    Unfortunately not. I ended up having to create the code for this shortcode in php.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Multiple Orderby Not Working’ is closed to new replies.