WordPress Quicky: Query Posts by Custom Meta Field

If you have already added a custom meta field to your wordpress posts with add_meta_box you probably want to query such posts in your template. You can do that with query_posts(), it supports the meta_key and meta_value attributes.

 
query_posts($query_string.'&meta_key=onStartpage&meta_value=1');