eb29
Forum Replies Created
-
Hello Patrick,
I still think I can not make myself understood.
Again, I only have one page template for all my placements.
So what I want is not to get out of the loop but to insert elsewhere in the page, and not in “the_content” the list of events of the location (what does the Events Manager plugin do in the configuration options ).
I have created tabs with the address, the practical information of the site, and I would like to see in this block the list of events of the location.Unfortunately your code does not work … I hope I was explicit enough this time and you can help me!
This is my code in /content-emplacement.php :
<?php /** Vérifier l'activation de ACF */ if ( !function_exists('get_field') ) return; ?> <div id="tabs"> <div class="tab"><input id="tab-1" type="radio" checked="checked" name="tab-group-1" /> <label for="tab-1">Adresse</label> <div class="contenu"> <?php if( get_field('adresse') ): ?> <?php the_field('adresse'); ?><br/><?php endif; ?> <?php if( get_field('code-postal') ): ?><?php the_field('code-postal'); ?><?php endif; ?> <?php if( get_field('ville') ): ?> <?php the_field('ville'); ?><br/><br/><?php endif; ?> <?php if( get_field('numero_tel') ): ?> <?php the_field('numero_tel'); ?><br/><br/><?php endif; ?> <?php if( get_field('adresse_mail') ): ?> <a href="mailto:<?php the_field('adresse_mail'); ?>"><?php the_field('adresse_mail'); ?></a><br/><br/><?php endif; ?> <?php if( get_field('site_web') ): ?><a href="<?php the_field('site_web'); ?>"><?php the_field('site_web'); ?></a><br/><?php endif; ?> <?php if( get_field('lien_carte') ): ?> <?php the_field('lien_carte'); ?><br/> <?php endif; ?> </div> </div> <?php if( get_field('infos-pratiques_check') == 'oui' ): ?> <div class="tab"><input id="tab-2" type="radio" name="tab-group-1" /> <label for="tab-2">Informations pratiques</label> <div class="contenu"> <?php if( get_field('horaires') ): ?> <h4> Horaires : </h4><?php the_field('horaires'); ?><br/> <?php endif; ?> <?php if( get_field('tarifs') ): ?> <h4>Tarifs : </h4><?php the_field('tarifs'); ?> <?php endif; ?> </div> </div> <?php endif; ?> <div class="tab"><input id="tab-3" type="radio" name="tab-group-1" /> <label for="tab-3">événements</label> <div class="contenu"> -----------------HERE IS WHERE I WANT To INSERT THE EVENT LIST----------------- </div> </div> </div> <? php the_content(); ?>
Thank you again by advance !
?? `- This reply was modified 6 years, 4 months ago by eb29.
Indeed, you must be right … So what would be the complete code to display in my template for my site page?
$EM_Location->output("#_LOCATIONNEXTEVENTS");
doesn’t work…
I tried `if (class_exists(‘EM_Events’)) {
echo EM_Events::output( array(‘limit’=>10,’orderby’=>’name’) );
}` but the list shows all the events and not only those of the location.
Thank you by advance !- This reply was modified 6 years, 4 months ago by eb29.
And I forgot : I have only one template for all the locations…
Thank you by advance !Hello Patrick and thank you for your reply !
I actually used the ‘EM Locations’ to create each museum page.
When the site will be officially online, this museum network will intend to grow and the future webmaster of the site will have to add a new ‘EM Location’ page each time a new member will join the network.
However, since it is impossible to know how many new museums will join the network, the code for displaying museum events is located in the Location template page. (can’t use a shortcode in each page)
So I need the php function that calls the event list associated with each location, new or old, in my template.
I can not use your code because it would mean adding a line of code to each new location … to infinity.Another idea maybe?
Thank you for your reply !
I think, however, that I have misunderstood myself.
The slider I use on the site retrieves the custom_post_type EVENT generated by EVENTS MANAGER events to display the most recent events in the slider.
What’s missing about the result of the slider’s display is actually the dates (start and end) and the times on the events.
And for that, I can not enter anywhere shortcode / placeholder, the only way seems to be to modify the loop.
A suggestion for that?