Commit 31305ace authored by Nathan Peraldi's avatar Nathan Peraldi

improve of event displaying

parent 9f8fd879
<?php
/*
/*
* Remember that this file is only used if you have chosen to override event pages with formats in your event settings!
* You can also override the single event page completely in any case (e.g. at a level where you can control sidebars etc.), as described here - http://codex.wordpress.org/Post_Types#Template_Files
* Your file would be named single-event.php
......@@ -8,21 +8,19 @@
* This page displays a single event, called during the the_content filter if this is an event page.
* You can override the default display settings pages by copying this file to yourthemefolder/plugins/events-manager/templates/ and modifying it however you need.
* You can display events however you wish, there are a few variables made available to you:
*
* $args - the args passed onto EM_Events::output()
*
* $args - the args passed onto EM_Events::output()
*/
function recup_nombre()
{
global $wpdb;
$search = "ag-adullact-2019";
$post = "post_name";
$link = $_SERVER["REQUEST_URI"];
$search = explode("/",$link)[2];
$search = explode("/", $_SERVER["REQUEST_URI"])[2];
$query = "SELECT count(meta_value) as number FROM wp5304_postmeta WHERE meta_value LIKE '%" . $search . "%' && meta_value LIKE '%" . $post . "%'";
$result = $wpdb->get_results($query);
echo "Nombre d'inscrits à l'événement : " . $result[0]->number;
echo "<div id='adullact-nombre-inscrits'>Nombre d'inscrits : " . $result[0]->number . "</div>";
}
global $EM_Event;
......@@ -30,4 +28,5 @@ global $EM_Event;
recup_nombre();
echo str_replace("Carte non disponible","",$EM_Event->output_single()); ?>
\ No newline at end of file
//du texte inutile à propos de la carte apparait, impossible de le retirer autrement !
echo str_replace("Carte non disponible", "", $EM_Event->output_single()); ?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment