Display pages with cumstom field date upcoming
-
Try this for some time and a big headache for me. So I want to show 2 pages that have custom data field (example: 1 Martie 2013) – in Romanian and the custom field value is greater than today.
For example:
Page 1 – custom field “launch date” is “1 Martie 2013”
Page 2 – custom field “launch date” is “1 Martie 2013”
Page 3 – custom field “launch date” is “1 Martie 2013”We are now in “2 Martie 2013” and I want to show only pages 2 and 3.
Now, I try this
<?php $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1; $today = date('j F Y'); query_posts(array(, 'posts_per_page' => 2, 'paged' => $paged, 'meta_key' => 'data-lansare', 'orderby' => 'meta_value', 'order' => 'ASC', 'meta_query' => array( array( 'key' => 'data-lansare', 'meta-value' => $value, 'value' => $today, 'compare' => '>=', 'type' => 'CHAR' ) ) )); if (have_posts()) : while (have_posts()) : the_post(); ?>
not working!
I try to change custom field date to format YYYYMMDD edit couple of pages custom field “data-lansare” (ex: 20130301) and change $today = date(‘j F Y’); with $today = date(‘Ymd’); but again nothing works.
A little help.
- The topic ‘Display pages with cumstom field date upcoming’ is closed to new replies.