Skip to content

Instantly share code, notes, and snippets.



Created Mar 6, 2010
What would you like to do?
//The Query
// exactly than
// or
// dates less than
// query_posts('meta_key=start_date&meta_compare=<=&meta_value='.date("Y-m-d"));
// or
// date mayor than
// query_posts('meta_key=start_date&meta_compare=>=&meta_value='.date("Y-m-d"));
//The Loop
if ( have_posts() ) : while ( have_posts() ) : the_post();
echo the_title();
echo "<br />";
endwhile; else:
//Reset Query

This comment has been minimized.

Copy link

@e1e1e1 e1e1e1 commented Nov 11, 2011

Hi Hunk
Could you help me.
Im using magic field on my custom wordpress template

            <?php while($wp_query ->have_posts()) : $wp_query ->the_post();?>
    <li class="boxgrid slidedown">
        <div class="cover">
            <div class="datewrap">
                <div class="closedt">
                    <p>CLOSES<br/><?php echo get('end');?></p></div>
                <div class="country"><p>OPEN FOR: <br/>
                        <?php $value = get('NZ');
                        if($value){echo "NZ";
                        <?php $value2 = get('AUS');
                        if($value2){echo "AUS";
            </div><!--/datewrap  -->
            <div class="thumb">
                <img src="<?php echo get('image');?>" alt="<?php the_title(); ?>"/></div>
            <div class="mlisthead">
                <h1><?php the_title(); ?></h1></div>
        <div class="excerpt">
            <p><?php $excerpt = get_the_excerpt();
                    echo string_limit_words($excerpt,15);?><br/></p>
            <div class="enterbtnA" >
            <a href="<?php the_permalink() ?>" >MORE</a></div>
    <?php endwhile; ?>
    <div id="paginate"><?php wp_paginate();?></div>

I try filter my qurey base on magic field checklist, but doesnt work. could you point me which part i missed


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment