i would like to alphabetize the tag.php page results with custom fields i have created for posts
i have added “last-name” and “first-name” fields and i would like my results to be sorted by last, and then first.
in order to alphabetize the results, before the loop
<?php while (have_posts()) : the_post(); ?>
i put
<?php
// sort alphabetically
$posts = query_posts($query_string .
'&orderby=title&order=asc&posts_per_page=-1'); ?>
the problem is that it is taking the first letter of the title.
need to figure out how to query the custom fields
thanks
Hi @ddd777
In order to filter your tags by a custom field, kindly have a look at this article that may help you out
https://www.advancedcustomfields.com/resources/query-posts-custom-fields/
Let me know how it goes.