[wp-hackers] Sorting queries by values in custom array?

Nathaniel Taintor goldenapplesdesign at gmail.com
Thu Aug 19 16:27:07 UTC 2010


I'm working with about 40 cities to start, in two categories... 30 US and 10
international, which get processed differently (i.e. someone searching in
Tokyo doesn't need to see San Franciso as a "nearby city", just because it
may be the closest geographically.

The sorting cities function performs ok, and I can cache the results of that
function so it doesn't get run every page load. The big slowdown is running
20-30 get_posts queries on every index page. And it makes it very difficult
and slow to page the results. I've been trying to come up with a hack to
return these results in a single query that can be paged.

Thanks.



On Thu, Aug 19, 2010 at 11:35 AM, Mike Schinkel <mikeschinkel at newclarity.net
> wrote:

> I was working on almost this exact problem yesterday.
>
> How many total cities do you have?
>
> -Mike
>
>


More information about the wp-hackers mailing list