Post Query not working after updating to 4.1

I formed this query based on this answer. I would appear this is no longer the way to do it… I reformatted the query to look like this: query_posts( array( ‘post_type’ => ‘events’, ‘showposts’ => -1, ‘order’ => ‘ASC’, ‘orderby’ => ‘meta_value_num’, ‘meta_query’ => array( ‘relation’ => ‘OR’, array( ‘key’ => ‘_ecmb_datetime’, ‘value’ => strtotime(‘today … Read more

WP Query between posts custom fields [duplicate]

Problem solved, I’ve used this: $d=new WP_Query( array( ‘category__in’ => array(4), ‘post_type’ => ‘post’, ‘posts_per_page’ => ‘-1’, ‘orderby’ => ‘meta_value’, ‘order’ => ‘ASC’, ‘meta_query’ => array( ‘relation’ => ‘AND’, array( ‘key’ => ‘data’, ‘value’ => $t, ‘compare’ => ‘<=’ ), array( ‘key’ => ‘data’, ‘value’ => $o, ‘compare’ => ‘>=’ ) ), ) ); Instead … Read more

display news with pictures 3 small and one large (loop)

I don’t know why have you put $b%4==1 condition. You can simply check for $b==1.And one more thing I would suggest is to use if and else both.So code would be something like this: <?php $b=1; $args = array( ‘tax_query’ => array( array( ‘taxonomy’ => ‘gens’, ‘field’ => ‘slug’, ‘terms’ => ‘newsgen’ ) ), ‘post_type’=>”, … Read more

Add filter to Orderby Parameter using Array

Thanks karpstrucking, This was a simple case of me needing to understand the Query better. Once I fully understood that wp_query returns a string for the sql query, it was a simply case of doing what I needed to do to correction the event_date value, concatenating on the additional title or meta_num_value and returning that. … Read more

Featured image not showing on page

From the url you supplied it looks like you are using a custom post type of blog. The most likely reasons you are not seeing the post you want to display is that by default WP_Query is only set to display posts – see WordPress Codex on WP_Query Post & Page Parameters for more info. … Read more