bump.
Sorry to have to bother the forum again, but I find myself in a scenario where I need to sort this, and make the headers, by a custom field rather by post_title (client request).
This seems to work fine for sorting:
$last_char = '';
$args=array(
'category__in' => array(3,7,45,2),
'orderby' => 'guest_sort',
'order' => 'ASC',
'posts_per_page'=>-1,
'caller_get_posts'=>1
);
But I'm not sure how to figure out getting the headers to use the custom field as well.
I tried this:
$post->guest_sort
but that was wrong.
Then I tried pulling the custom filed value into a variable with get_post_meta but I'm probably doing it wrong:
$guestSort = get_post_custom_values('guest_sort');
$this_char = strtoupper(substr($guestSort,0,1));
but that didn't work. I also tried stringing together a meta_value&meta_key=guest_sort string, but that didn't work.
$this_char = strtoupper(substr($post->meta_value&meta_key=guest_sort,0,1));`
Suggestions?
Thank you.
Nadine.