you can try something like wp-content/themes/Avada/plugins/events-manager/templates/event-single.php
But yes, this is what I said I did, but it does nothing.
Did I miss something?
Also, as in the event-single there is written:
/* Your file would be named single-event.php*/
I have tried renaming it to single-event.php, and does not work as well.
Do I have to do something in the settings to have events manager use my template instead of the default.
Also, I have to disable “use format” for this to works, isn’t it?
Thanks
Ok I found what’s wrong. I have to enable “use format” 🙂
Though now there is something I don’t understand… is this possible to use placeholders in the template .php file?
The default file shows something like:
echo $EM_Event->output_single();
So I think this displays the event, according to the “format” in the settings.
But what about if we want to create the whole display in the template file, without using the “format”? Can I do that? How do I put placeholders into my php file, to display event infos?
Thanks
-
This reply was modified 9 years, 3 months ago by
harf4ng.
-
This reply was modified 9 years, 3 months ago by
harf4ng.
Haven’t tested this but I’m pretty sure you can do something like this:
echo $EM_Event->output_single("#_EVENTNAME");
Seems it does not work.
Returns nothing.
My php code is like that:
global $EM_Event;
/*@var $EM_Event EM_Event;*/
echo $EM_Event->output_single(“#_EVENTNAME”);
And it returns nothing.
If I try just a echo “hello” then it works, I see the text “hello”, but the php with $EM_Event does not work.
Any idea?
Thanks
I think the solution is to wrap the placeholders around the shortcode you want to use:
http://wp-events-plugin.com/documentation/advanced-usage/
In fact I managed to do this like this…
I have used both the “format” and template file.
In the format I have put:
<div class=”return-list-events”>← Retour à la liste des événements</div>
<div class=”event-name”><h2>#_EVENTNAME</h2></div>
<div style=”float:right; margin:0px 0px 15px 15px;”>#_LOCATIONMAP</div>
<p>
Date / Heure<br/>
Date(s) – #_EVENTDATES<br /><i>#_EVENTTIMES</i>
</p>
{has_location}
<p>
Emplacement<br/>
#_LOCATIONNAME
</p>
{/has_location}
<p class=”categories”>
Catégorie<br />
#_CATEGORYNAME
</p>
<!–#_ATT{Organisateur}
#_ATT{Nom du contact}
#_ATT{Téléphone du contact} –>
And in the php file I have put:
echo $EM_Event->output_single();
$organisateur = get_post_meta($postID, ‘Organisateur’, true);
$contactname = get_post_meta($postID, ‘Nom du contact’, true);
$contactphone = get_post_meta($postID, ‘Téléphone du contact’, true);
if ($contactname != ”)
{
echo ‘<p class=”event-contact”>’;
echo ‘Organisateur<br />’;
echo ‘<span class=”event-organisateur”>’, $organisateur, ‘</span><br />’;
echo ‘Contact : ‘, $contactname, ‘ (‘, $contactphone, ‘)’;
echo ‘</p>’;
}
echo ‘<br style=”clear:both” />’;
/*echo get_post_meta($postID, ‘#_EVENTNOTES’, true);*/
echo get_post_field(‘post_content’, $postID);
This way I used format, and I used the php for things that need php.
-
This reply was modified 9 years, 2 months ago by
harf4ng.
Note that I have put my custom attributes in comments inside the format setting, because if I omit them, even if I display them in the php file, they are not available when I create an event.