Using query_args with Custom Fields

Community Forums Forums Design Tips and Tricks Using query_args with Custom Fields

This topic is: resolved


This topic contains 3 replies, has 2 voices, and was last updated by  rfmeier 2 years, 5 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #46426


    I’m modifying the Agency theme on this site in production:

    This page shows a Blog listing of Posts in the “Professionals” category – I get this by using the query_args in the custom fields area. I’m using this value in the query_args key:


    It shows the posts that I want but I want to have the posts sorted in alphabetical order by their LAST name. I was thinking of the following options:

    • Set the publication date of the posts in the order that I want (not user friendly for the client)


    • Create some type of custom field key and value to sort the posts by

    Does anyone know of a good/quick way to do this with query_args or do I need to create a custom Blog Listing page template?

    Thanks for your input. Chris




    If you are sorting by custom meta, you can use these parameters specified within the WordPress documentation.

    I hope this points you in the right direction.



    Thanks Ryan. I did visit that page and it was a bit vague on the syntax. I wasn’t sure how to represent the key name and such.

    So I tried another go at it. I was successful with the following:


    So this took my manually entered Custom Field values assigned to the key “last_name” and sorted them alphabetically (since they were alpha characters). Thanks for the link and nudge to try it again.




    You are welcome. Good luck.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.