Created
February 22, 2018 13:56
-
-
Save matthewtlh/2fca9fecfaa7344dab881a2975385b84 to your computer and use it in GitHub Desktop.
not working meta query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$args = array( | |
'post_type' => 'event', | |
'order' => 'ASC', | |
'meta_query' => array( | |
'key' => 'date ordering format - YYYY-MM-DD', | |
'orderby' => 'meta_value', | |
'relation' => 'AND', | |
array( | |
'key' => 'event category (events feed page)', | |
'value' => 'Dinner Series', | |
'compare' => 'EXISTS' | |
), | |
array( | |
'key' => 'Past Event', | |
'value' => 'Past', | |
'compare' => 'NOT EXISTS' | |
), | |
'relation' => 'AND', | |
array( | |
'key' => 'Past Season', | |
'value' => 'true', | |
'compare' => 'NOT EXISTS' | |
), | |
), | |
); | |
$my_query2 = new WP_Query($args); | |
if( $my_query2->have_posts() ) { | |
while ($my_query2->have_posts()) : $my_query2->the_post(); | |
echo '<div class="fullWidthSeason">'; | |
if (class_exists('MultiPostThumbnails')) : | |
MultiPostThumbnails::the_post_thumbnail( | |
get_post_type(), 'series-image', $post->ID, 'full',NULL, FALSE | |
); | |
endif; | |
echo '<div class="featuredBlockDate '.get_post_meta($post->ID, 'Series Page text left or right align', true).' '.get_post_meta($post->ID, 'Black Text', true).' '.get_post_meta($post->ID, 'Black Text', true).'">'; | |
echo get_post_meta($post->ID, 'H1 date (Series Page + Event Page description)', true); | |
echo '</div>'; | |
echo '<div class="featuredBlockTitle '.get_post_meta($post->ID, 'Series Page text left or right align', true).' '.get_post_meta($post->ID, 'Black Text', true).'">'; | |
echo get_post_meta($post->ID, 'Season Page Title', true); | |
echo '</div>'; | |
echo '<div class="featuredBlockExcerpt '.get_post_meta($post->ID, 'Series Page text left or right align', true).' '.get_post_meta($post->ID, 'Black Text', true).'">'; | |
echo the_excerpt(); | |
echo '</div>'; | |
echo '<div class="moreButton '.get_post_meta($post->ID, 'Series Page text left or right align', true).'">'; | |
echo '<div class="moreButtonSeason '.get_post_meta($post->ID, 'Series Page text left or right align', true).'"><a href="'.get_post_meta($post->ID, 'featured/series button address', true).' " target="_blank">'.get_post_meta($post->ID, 'featured/series button text', true).'</a></div>'; | |
echo '</div>'; | |
echo '</div>'; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment