Wp Query : Order by distance lat,lon

This may not be possible using what WP_Query gives you out of the box, it wasn’t designed to do math across multiple parameters for sorting. You can filter via meta_query and provide bounds, and you can order by a single value, you can even order by multiple values, e.g. show all items by their lat, … Read more

Is there a way to define the $post var outside the loop?

I think setup_postdata($post) (internal) function does that. I failed to find proper documentation for it in Codex (typical), but there are examples with it here and there like in Displaying Posts Using a Custom Select Query. This test snippet seems to work fine for example code you have in question: foreach ( $cat1 as $post … Read more

How can I change how my tag pages display?

First, the root of your issue is that WordPress has two very different template tags to output posts: the_content() and the_excerpt(). There are a lot of nuances with these and many get details wrong, I did my best to get everything right in post at my blog if you are interested that Make sense of … Read more