admin管理员组

文章数量:1323348

We are usign this plugin: /

We want something like this on a single event page.

I am struggling with how to output PLACEHOLDER in my PHP File:

if(event_scope == PAST){
//Display with this HTML
}
else{
//Normal Display
}

To achieve this, I have copied single event file to /wp-content/themes/my-child-theme/plugins/events-manager/templates/event-single.php

and here is the code I added. Its working but I dont know what to use in the Placeholders

if($EM_Event->event_end_date < date('Y-m-d')){
    echo 'PAST';
    <div class="single-event-detail-header">Event Details</div>
<div class="single-event-desc">
<div class="event-image">#_EVENTIMAGE</div>
<ul class="event-details-list">
  <li><span class="date-icon">#l | #_EVENTDATES</span></li>
  <li><span class="time-icon">#_EVENTTIMES </span></li>
{has_location}
<li>
    <span class="location-icon"> #_LOCATIONNAME 
        #_LOCATIONADDRESS #_LOCATIONTOWN #_LOCATIONSTATE #_LOCATIONPOSTCODE
    </span></li>
{/has_location}
[listMembertypes]
{no_location}
<li><img class="video-confress" src="/wp-content/uploads/2020/08/video.png" alt="" style="width: 18px;"><span class="zoom-webinar" style="left: 13px;">Zoom Webinar</span></li>
{/no_location}
</ul>
</div>
<ul class="event-buttons">
        <li class="register"><a href="#_ATT{registration_link}" target="_blank">Register</a></li>
                
</ul>
#_EVENTNOTES
{has_bookings}
<h3>Bookings</h3>
#_BOOKINGFORM
{/has_bookings}

<div class="next-location">
<p><strong>Upcoming Events:</strong>
#_LOCATIONNEXTEVENTS
</div>
</br>
<div class="float-map-right">{has_LOCATIONMAP}#_LOCATIONMAP<br />{/has_LOCATIONMAP}
    {has_locationnextevents}
    <h3>Events at This Location</h3>
    {/has_locationnextevents}
</div>
    
    ?>

<?php
}else{
    echo 'Future';
    
}

We are usign this plugin: https://wordpress/plugins/events-manager/

We want something like this on a single event page.

I am struggling with how to output PLACEHOLDER in my PHP File:

if(event_scope == PAST){
//Display with this HTML
}
else{
//Normal Display
}

To achieve this, I have copied single event file to /wp-content/themes/my-child-theme/plugins/events-manager/templates/event-single.php

and here is the code I added. Its working but I dont know what to use in the Placeholders

if($EM_Event->event_end_date < date('Y-m-d')){
    echo 'PAST';
    <div class="single-event-detail-header">Event Details</div>
<div class="single-event-desc">
<div class="event-image">#_EVENTIMAGE</div>
<ul class="event-details-list">
  <li><span class="date-icon">#l | #_EVENTDATES</span></li>
  <li><span class="time-icon">#_EVENTTIMES </span></li>
{has_location}
<li>
    <span class="location-icon"> #_LOCATIONNAME 
        #_LOCATIONADDRESS #_LOCATIONTOWN #_LOCATIONSTATE #_LOCATIONPOSTCODE
    </span></li>
{/has_location}
[listMembertypes]
{no_location}
<li><img class="video-confress" src="/wp-content/uploads/2020/08/video.png" alt="" style="width: 18px;"><span class="zoom-webinar" style="left: 13px;">Zoom Webinar</span></li>
{/no_location}
</ul>
</div>
<ul class="event-buttons">
        <li class="register"><a href="#_ATT{registration_link}" target="_blank">Register</a></li>
                
</ul>
#_EVENTNOTES
{has_bookings}
<h3>Bookings</h3>
#_BOOKINGFORM
{/has_bookings}

<div class="next-location">
<p><strong>Upcoming Events:</strong>
#_LOCATIONNEXTEVENTS
</div>
</br>
<div class="float-map-right">{has_LOCATIONMAP}#_LOCATIONMAP<br />{/has_LOCATIONMAP}
    {has_locationnextevents}
    <h3>Events at This Location</h3>
    {/has_locationnextevents}
</div>
    
    ?>

<?php
}else{
    echo 'Future';
    
}
Share Improve this question edited Sep 8, 2020 at 14:59 fuxia 107k38 gold badges255 silver badges459 bronze badges asked Sep 8, 2020 at 7:05 vanuragvanurag 1117 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

You need to move your template files - instead of

/wp-content/themes/my-child-theme/plugins/events-manager/templates/event-single.php

you should put them here:

/wp-content/themes/my-child-theme/events-manager/event-single.php

See this documentation page: https://wp-events-plugin/documentation/using-template-files/

本文标签: pluginsSingle Event page based on scope and use of PLACEHOLDER in PHP template file