Home › Forums › Add-ons › Repeater Field › Calendar by month with date repeater › Reply To: Calendar by month with date repeater
hi james,
Thank you for your help.
here is my current code
<?php
/**
* Template Name: Calendrier
*/
?>
<?php get_header(); ?>
<?php
$rows = $wpdb->get_results($wpdb->prepare(
"
SELECT *
FROM {$wpdb->prefix}postmeta
WHERE meta_key LIKE %s
",
'calendrier_%_jour_debut'
));
/// var_dump($rows);
/*
array(5) {
[0]=>
object(stdClass)#6662 (4) {
["meta_id"]=>
string(4) "1956"
["post_id"]=>
string(3) "408"
["meta_key"]=>
string(23) "calendrier_0_jour_debut"
["meta_value"]=>
string(8) "20160704"
}
[1]=>
object(stdClass)#6676 (4) {
["meta_id"]=>
string(4) "2183"
["post_id"]=>
string(3) "441"
["meta_key"]=>
string(23) "calendrier_0_jour_debut"
["meta_value"]=>
string(8) "20160910"
}
[2]=>
object(stdClass)#6717 (4) {
["meta_id"]=>
string(4) "2204"
["post_id"]=>
string(3) "442"
["meta_key"]=>
string(23) "calendrier_0_jour_debut"
["meta_value"]=>
string(8) "20160927"
}
[3]=>
object(stdClass)#6716 (4) {
["meta_id"]=>
string(4) "1972"
["post_id"]=>
string(3) "408"
["meta_key"]=>
string(23) "calendrier_1_jour_debut"
["meta_value"]=>
string(8) "20160924"
}
[4]=>
object(stdClass)#6715 (4) {
["meta_id"]=>
string(4) "1990"
["post_id"]=>
string(3) "408"
["meta_key"]=>
string(23) "calendrier_2_jour_debut"
["meta_value"]=>
string(8) "20160709"
}
} */
$rows = get_field ('calendrier');
// var_dump($rows); = NULL
// vars
$order = array();
// populate order
foreach( $repeater as $i => $row ) {
$order[ $i ] = $row['id'];
}
//var_dump($order);
/*
array(0) {
}
*/
?>
<?php get_footer(); ?>
:s
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.