- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
$confs = array();
$q = new WP_Query(array('post_type' => 'conference',
'posts_per_page' => -1,
'meta_key' => 'cd-conference-date-start',
'orderby' => 'meta_value_num',
'order' => 'DESC'
));
while($q->have_posts()): $q->the_post();
$confs[date("Y", get_post_meta($post->ID, 'cd-conference-date-start', true))][] = array('conf_title' => get_the_title(),
'conf_date_start' => get_post_meta($post->ID, 'cd-conference-date-start', true),
'conf_date_end' => get_post_meta($post->ID, 'cd-conference-date-end', true),
'conf_link' => get_permalink(),
'conf_city' => get_post_meta($post->ID, 'cd-conference-city', true),
'conf_icon' => get_the_post_thumbnail()
);
endwhile;
wp_reset_postdata();
WordPress. Глубже, чем вы себе можете представить.
Lowezar 18.09.2012 00:13 # +1
varg242 18.09.2012 00:15 # −1
Lure Of Chaos 18.09.2012 03:01 # −2