• Resolved michaelwellnerwp

    (@michaelwellnerwp)


    I created a single-event.php file in order to have a custom event single page.

    My code:

    <?php
    the_header();
    the_content();
    the_footer();
    ?>

    At the moment, the_content() outputs what I declared as default html on the settings page.

    I would like to insert my custom html directly into the single-event.php file. Example:

    <?php 
    the_header();
    ?> 
    
    <p>Here comes my custom HTML:</p>
    <p>
    	<strong>Datum/Zeit</strong><br/>
    	Date(s) - #_EVENTDATES<br /><i>#_EVENTTIMES</i>
    </p>
    {has_location}
    <p>
    	<strong>Veranstaltungsort</strong><br/>
    	#_LOCATIONLINK
    </p>
    {/has_location}
    <p>
    	<strong>Kategorien</strong>
    	#_CATEGORIES
    </p>
    <br style="clear:both" />
    #_EVENTNOTES
    {has_bookings}
    <h3>Buchungen</h3>
    #_BOOKINGFORM
    {/has_bookings}
    
    <?php
    the_footer();
    ?>

    This code does not work. The placeholders do not get populated.
    How do I need to adapt the code for it to work?

Viewing 1 replies (of 1 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    did you already set your events > settings > pages > event pages > display event as =Post and then try the snippet below in your single-event.php

    
    <div class="post-content">
    	<?php 
    	global $post;
    
    	$EM_Event = em_get_event($post->ID, 'post_id');
    	
    
    	//use something like this 
    	echo  $EM_Event->output('#_EVENTNOTES');
    	
    	//or this; formatting can be set under Events > Settings > Formatting > Events > Single event page format
    	$format   =  get_option ( 'dbem_single_event_format' );
    	echo  $EM_Event->output($format);
    	
    	
    	?>
    </div>
    
Viewing 1 replies (of 1 total)
  • The topic ‘Putting HTML code inside single-event.php’ is closed to new replies.