• I have a CPT called Team Members with custom fields for Name and Sort Order. The Sort Order custom field contains LastNameFirstInitial e.g. “welcherr”.

    How do I setup AQL Post Order and Post Meta Query to sort the list of name by the sort order custom field. The CPT and Custom fields were setup using Meta Box (metabox.io).

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Ryan Welcher

    (@welcher)

    Thanks for reaching out!

    You will need to set up a meta query first to define how you want to retrieve posts. Once that is in place, you can choose to sort by Meta Value and that should be it. See the screenshot below for an example I set up using my testing environment.

    I have not tested this plugin with Meta Box so please let me know if you run into issues.

    Edit Post Advanced Query Loop twitch streams WordPress
    Thread Starter Steve West

    (@espedub)

    Thanks for the reply. I have 2 issues when using AQL:

    1. I am getting the following PHP warnings on the front end:
      • Warning: Undefined array key “multiple_posts” in?/Users/espedub/Local Sites/dpl/app/public/wp-content/plugins/advanced-query-loop/includes/query-loop.php?on line?70
      • Warning: Undefined array key “multiple_posts” in?/Users/espedub/Local Sites/dpl/app/public/wp-content/plugins/advanced-query-loop/includes/query-loop.php?on line?70

    2. Below is a link to a screenshot of my Post Order and Post Meta Query settings. The META KEY is team_sort_order, a custom field that contains a string of LastNameFirstInitial. I want to sort the output of the query by that field. I don’t know what to put into the META VALUE field – each record will have a different meta value for team_sort_order.

    https://monosnap.com/file/MlU4WtbClL31pQSE92C3gpy79eWHUE

    Plugin Author Ryan Welcher

    (@welcher)

    Thanks for sharing that screenshot. You can leave the Meta Value field blank and that should give you all posts with the team_sort_order meta.

    Those PHP warnings are not related but I will fix them with the next release. Thanks!

    Plugin Author Ryan Welcher

    (@welcher)

    Just wanted to follow up here to see if this is still an issue.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to setup Post Order and Post Meta Query to sort by a custom field’ is closed to new replies.