hi james
The screenshot
Back end Page “calendrier” :
Current Front :
Result : (the html / Css / JS are OK)
thanks
Hello James
Thank you very mutch for your help. I decided to change method.
I have created one page “calendar” with my repeater and i use relationship for the relation with my event.
my current code is :
<?php
/**
* Template Name: Test Calendrier
*/
?>
<?php get_header(); ?>
<div class="title-page no-thumb">
<?php
if( have_rows('calendrier') ) :
while ( have_rows('calendrier') ) :
the_row();
$date_debut = get_sub_field('jour_debut');
$mois_spectacle = explode(" ", $date_debut)[1];
echo '<h1>'.$mois_spectacle.'</h1>';
?>
<?php
$posts = get_sub_field('spectacle');
?>
<?php
foreach( $posts as $post):
?>
<?php setup_postdata($post); ?>
<div>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
<span>Date début : <?php echo $date_debut ?></span>
</div>
<?php
endforeach;
?>
<?php wp_reset_postdata();?>
<?php
endwhile;endif;
?>
</div>
<?php
get_footer(); ?>
now i must merge the month and event similar.
but I do not know how…
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
with this request I got it . I do not know what to do.
there all my time and all my post
array(5) {
[0]=>
object(stdClass)#6665 (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)#6683 (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)#6724 (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)#6723 (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)#6722 (4) {
[“meta_id”]=>
string(4) “1990”
[“post_id”]=>
string(3) “408”
[“meta_key”]=>
string(23) “calendrier_2_jour_debut”
[“meta_value”]=>
string(8) “20160709”
}
wouaou !!!!
it becomes too complex for me 🙁
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.