I think getting ALL the posts with the city = Melbourne and then checking ALL of them against ALL the posts that you are attempting to show on the page is the wrong way about it.

Why not use the single loop that you should already have and put something like this to check if the city is Melbourne?

 &lt;?php
    //check custom field 'city'
    $custom_field = get_post_custom();              
    if(isset($custom_field["city"][0]) &amp;&amp; $custom_field["city"][0] != 'Melbourne')
    {
        //output
    }
    else
    { 
        //do something else?
    }
 ?&gt;


How do I exclude posts by custom field value?
How do I hide my javascript/jquery scripts from html page  (from view source on right click)? please give suggestion to achive this .

Thanks.
