I've got a custom php page for any client. Basically this site can place out posts with a publish_meta date (known as open_date). Also incorporated for every item with open_date set is 2 more (open_start) and (open_close). Should you havn't figured it, to a celebration type listing.

Ultimately what I am after is really a script to obtain all posts with this particular meta and display them so as. Good examples of every metas value below. Not necessarily sure how to start scripting, so my snippet is quite missing..

e.g.'s open_date = 12/05/2011 open_start = 12:10 pm open_close = 02:00 pm

and my script to date

$masterquery = "SELECT * from wp_postmeta WHERE meta_key = 'open_date'";
$masterreslt = mysql_query($masterquery) or die(mysql_error());
while($masterdata = mysql_fetch_array($masterreslt)) {
    $new_array = $masterdata['meta_value'];
    if(!empty($masterdata['meta_value'])) {
        foreach($masterdata as $fullarray) {
            $post_id = $masterdata['post_id'];
            $open_date = $masterdata['open_date'];
            $open_start = $masterdata['open_start'];
            $open_close = $masterdata['open_close'];

            echo $post_id;
            echo '<br>';

            echo $open_date;
            echo '<br>';
        }

When I stated, rather missing and never too sure how to start. Never done anything such as this in Wordpress before.

Basically understand you properly you need to show posts between two dates (start and finish) To begin with you have to give a custom area (or metabox) in which you input two dates, one for start and something for finnish.

<?php 
$c = 0; $loop = new WP_Query( array( 'post_type' => <post_type>, 'posts_per_page' => -1, 'post_status' => 'publish', 'orderby' => 'date', 'order' => 'DESC' ));
echo '<ul>';
while ( $loop->have_posts() ) : $loop->the_post(); 
$end = get_post_meta($post->ID, 'end', true); 
$start = get_post_meta($post->ID, 'start', true);
$c++;
$y = strtotime($end); 
$x = strtotime($start);

//echo '<br />';
if ($y < $x) { next; } else {
?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php } 
echo '</ul>';
endwhile;

if ($c == 0) { 
echo '<p>None found.</p>';
}

}
?>

I have got this working after writing the code using normal PHP. I am sure there's Wordpress functions that may replace a number of this. However it works, that is all I want. The if statement about lastlist ensures it does not list replicates, as when editing posts these custom fields get added over and over. This question however will get just the latest of every listing.

my code:

  <?php
$lastlist = "";
$masterquery = "SELECT * from wp_postmeta WHERE meta_key = 'open_date' ORDER BY meta_value";
$masterreslt = mysql_query($masterquery) or die(mysql_error());
while($masterdata = mysql_fetch_array($masterreslt)) {
    $new_array = $masterdata['meta_value'];
    if(!empty($masterdata['meta_value'])) {
        foreach($masterdata as $fullarray) {
            $post_id = $masterdata['post_id'];

            $property_id = $post_id;

                if($property_id != $lastlist){

                $address = get_post_meta($property_id, 'address', true);

                $open_date = get_post_meta($property_id, 'open_date', true);
                $open_date = date(  "F j, Y", strtotime( $open_date ) );  
                $open_start = get_post_meta($property_id, 'open_start', true);
                $open_close = get_post_meta($property_id, 'open_close', true);
                $image = get_post_meta($property_id, 'red_image1', true);
                $excerpt = get_post($property_id, ARRAY_N);
                $excerpt = $excerpt['5'];
                $permalink = get_permalink( $property_id );

                echo "<div style=\"width:800px;\">";
                echo "<a href=\"$permalink\"><img style=\"width:250px; height:180px; float:left; margin:10px;\" src=\"$image\" /></a>";
                echo "<span style=\"float:right;width:530px;\"><a href=\"$permalink\"><h1>$address</h1></a></span>";
                echo "<span style=\"float:right;width:530px;\"><h2>$open_date $open_start to $open_close</h2></span>";
                echo "<span style=\"float:right;width:530px;\"><p>$excerpt</p></span>";
                echo "</div>";
                echo "<div style=\"clear:both;\">";
                $lastlist = $property_id;
        }
        }