• I followed the instructions on the support documents here
    http://docs.wp-event-organiser.com/theme-integration/faq/

    I copied my theme’s single.php to my theme child folder, renamed it to single-event.php, and then added the code suggested below the code in the template:
    <?php eo_get_template_part(‘event-meta’,’event-single’); ?>

    When I refresh the event, there is no event information on the page. My right sidebar is now floated all the way to the left, since there is no content.

    Which made me wonder if the code of my single.php template is different than you are expecting with your support documentation. The only code on that page is:
    <?php get_template_part(‘templates/content’, ‘single’); ?>

    So it seems to be fetching a third page to populate the page. Any suggestions on how to best tweak my event pages to look the way I want?

    I wanted to add: I tried using content.php and content-single.php as my template, moving it to my child folder and renaming it single-event.php and adding the code and had the same result. Is there some code that needs to be tweaked someplace else to make this work?

    Thanks so much for your time.

    • This topic was modified 6 years, 3 months ago by TribalDancer.
Viewing 1 replies (of 1 total)
  • guillermovargasquisoboni

    (@guillermovargasquisoboni)

    Hello Tribal Dancer,
    I made a custom single-event.php that is working well with a twentyfifteen child theme. I share my code with you maybe it can helps. If you want, you can share me your code and I can test it on my mamp environment :

    <?php
    /**
     * The template for displaying single events in http://lupita.artandfield.org
     *
     * 
     */
     
    //Call the template header
    get_header(); ?>
    
    <div id="primary" class="content-area">
    
        <main id="main" class="site-main" role="main">
        
            <div id="lupita-content">
    
            <header>
                <?php while ( have_posts() ) : the_post(); ?>
                
                <!-- Display event title -->
                <h1><?php the_title(); ?></h1>
                
                <div id="lupita-entry-meta">
    			 <?php
    			 //Events have their own 'event-category' taxonomy. Get list of categories this event is in.
    			$categories_list = get_the_term_list( get_the_ID(), 'event-category', '', ', ','' );
    
    			if ( '' != $categories_list ) {
    				$utility_text = __( 'Categorias: %1$s.</br> Texto publicado por <a href="%3$s">%2$s</a>.', 'eventorganiser' );
    			} else {
    				$utility_text = __( 'Texto publicado por <a href="%3$s">%2$s</a>.', 'eventorganiser' );
    			}
    			printf($utility_text,
    				$categories_list,
    				get_the_author(),
    				esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) )
    			);
    			?>
    
    			<?php edit_post_link( __( 'Edit' ), '<span class="edit-link">', '</span>' ); ?>
            </div><!-- .entry-meta -->
    
            </header><!-- #lupita-content header -->
            
            <div id="lupita-left-column">
    			<div id="event-image">
                    <?php
                    // Post thumbnail.
                    the_post_thumbnail('full'); 
                    echo "<div class='event-caption-text'>";
                    echo get_post(get_post_thumbnail_id())->post_excerpt;
                    echo "</div>";
                    ?>
                </div><!-- .post-thumbnail -->	
                
                <!-- The content or the description of the event-->
    				<?php the_content(); ?>
                
            </div><!-- closing left column -->
        
            <div id="lupita-right-column">         
    
                <div class="eventorganiser-event-meta">
    
                <!-- Event details -->
                <div id="event-details">
    	
                    <h2><?php _e('Informaciones prácticas') ;?></h2>
                    <ul>
                    <!-- The first element of the list is start and end dates of the event -->
                    <li><strong><?php _e('Fechas: ') ;?></strong><?php eo_the_start('j F Y'); ?> <?php _e(' - ') ;?><?php eo_the_end('j F Y'); ?></li>
    
                    <!-- The second element on the list is the venue -->
                    <?php if( eo_get_venue() ){
                    echo '<li>';
                    echo '<strong>'; 
    				echo "Lugar: "; 
    				echo '</strong>';
    				echo '<span><a href="';
                    echo eo_venue_link();
                    echo '">';
                    echo eo_venue_name();
                    echo '</a></span></br>';
    				$address_details = eo_get_venue_address();
    				echo '<i>'; 
    				echo "Dirección: "; 
    				echo '</i>';
    				echo $address_details['address'];
    				echo ", ";
    				echo $address_details['postcode']; 
    				echo " ";
    				echo $address_details['city'];
    				echo ", "; 
    				echo $address_details['country'];
    				echo ".";
    				echo '</li>';
      	             ?>
                        </ul>
                </div><!-- #event-details-->
    
    <!-- Display a map of the venue -->
                <div id="lupita-event-map">
                    <?php echo eo_get_venue_map(eo_get_venue(),array('width'=>'100%', 'height' => '300px') ); ?>
                </div><!-- lupita-venue-map -->
    
                <?php } ?>	
    		
                <div style="clear:both"></div>
    
                </div><!-- closing .event-meta -->
                
            </div><!-- lupita-right-column-->
    
        <div class="comments-template">
            <!-- If comments are enabled, show them -->
            <?php 
                // If comments are open or we have at least one comment, load up the comment template.
    			if ( comments_open() || get_comments_number() ) :
    				comments_template();
    			endif;
                    ?>
                </div>	
        
        <?php endwhile; // end of the loop. ?>
    
    </div><!-- lupita-content-->
    
    </main><!-- #content -->
    </div><!-- #primary -->
    
    <!-- Call template footer -->
    <?php get_footer(); 
Viewing 1 replies (of 1 total)
  • The topic ‘Custom single-event.php breaking page’ is closed to new replies.