Viewing 11 replies - 1 through 11 (of 11 total)
  • Create a new folder called “events” in your template directory and copy over the following files from within the plugin folder (the-events-calendar/views/):
    * gridview.php
    * list.php
    * single.php
    * events-list-load-widget-display.php

    Then modify the single.php file in your template directory as follow.

    Move the following code:

    <div class="entry">
    					<?php the_content() ?>
    					<?php if (function_exists('the_event_ticket_form')) { the_event_ticket_form(); } ?>
    				</div>

    and put it right after <div id="post-<?php the_ID() ?>" <?php post_class() ?>>

    So you’d end with a file like this:

    <?php
    	global $spEvents;
    	$spEvents->loadDomainStylesScripts();
    	get_header();
    ?>
    	<div id="tec-content" class="tec-event widecolumn">
    	<?php the_post(); global $post; ?>
    			<div id="post-<?php the_ID() ?>" <?php post_class() ?>>
                                <div class="entry">
    					<?php the_content() ?>
    					<?php if (function_exists('the_event_ticket_form')) { the_event_ticket_form(); } ?>
    				</div>
    				<span class="back"><a href="<?php echo events_get_events_link(); ?>"><?php _e('&laquo; Back to Events', $spEvents->pluginDomain); ?></a></span>
    				<h2 class="entry-title"><?php the_title() ?></h2>
    				<?php if (the_event_end_date() > time()  ) { ?><small><?php  _e('This event has passed.', $spEvents->pluginDomain) ?></small> <?php } ?>
    				<div id="tec-event-meta">
    					<dl class="column">
    						<dt><?php _e('Start:', $spEvents->pluginDomain) ?></dt>
    							<dd><?php echo the_event_start_date(); ?></dd>
    						<?php if (the_event_start_date() !== the_event_end_date() ) { ?>
    							<dt><?php _e('End:', $spEvents->pluginDomain) ?></dt>
    							<dd><?php echo the_event_end_date();  ?></dd>
    						<?php } ?>
    						<?php if ( the_event_cost() ) : ?>
    							<dt><?php _e('Cost:', $spEvents->pluginDomain) ?></dt>
    							<dd><?php echo the_event_cost(); ?></dd>
    						<?php endif; ?>
    					</dl>
    					<dl class="column">
    						<?php if(the_event_venue()) : ?>
    						<dt><?php _e('Venue:', $spEvents->pluginDomain) ?></dt>
    							<dd><?php echo the_event_venue(); ?></dd>
    						<?php endif; ?>
    						<?php if(the_event_zip()) : ?>
    						<dt><?php _e('Address:', $spEvents->pluginDomain) ?><br /><a class="gmap" href="<?php event_google_map_link() ?>" title="<?php _e('Click to view a Google Map', $spEvents->pluginDomain); ?>" target="_blank"><?php _e('Google Map', $spEvents->pluginDomain ); ?></a></dt>
    							<dd>
    							<?php tec_event_address( $post->ID ); ?>
    							</dd>
    						<?php endif; ?>
    					</dl>
    				</div>
    				<?php if(the_event_zip()) { event_google_map_embed(); } ?>
    
    				<?php edit_post_link('Edit', '<span class="edit-link">', '</span>'); ?>
    			</div><!-- .post -->
    
    		<?php if(eventsGetOptionValue('showComments','no') == 'yes'){ comments_template();} ?>
    
    	</div><!-- #tec-content -->
    
    <?php
    	get_footer();
    Thread Starter silvafer

    (@silvafer)

    Thanks for your help!
    I tried it out, and it nearly works!

    The issue is that the TITLE of the post is placed after the body of the post.
    (and « Back to Events is then placed in between the body and the title)

    See for example:

    http://www.groshgrup.net/blog/2010/04/ritorno-ai-bagni/

    Any idea on how I could place the title up?
    Post looks much nicer now, and the event data are less intrusive.
    (It would be great if there was an option in the plugin for choosing if post data are put before or after the body of the text).

    Many thanks

    Sorry my mistake in previous post. Try replacing the code in single.php as mentioned above with this:

    <?php
    	global $spEvents;
    	$spEvents->loadDomainStylesScripts();
    	get_header();
    ?>
    	<div id="tec-content" class="tec-event widecolumn">
    	<?php the_post(); global $post; ?>
    			<div id="post-<?php the_ID() ?>" <?php post_class() ?>>
    				<span class="back"><a href="<?php echo events_get_events_link(); ?>"><?php _e('&laquo; Back to Events', $spEvents->pluginDomain); ?></a></span>
    				<h2 class="entry-title"><?php the_title() ?></h2>
                                    <?php edit_post_link('Edit', '<span class="edit-link">', '</span>'); ?>
                                    <div class="entry">
    					<?php the_content() ?>
    				</div>
    
    				<?php if (the_event_end_date() > time()  ) { ?><small><?php  _e('This event has passed.', $spEvents->pluginDomain) ?></small> <?php } ?>
    				<div id="tec-event-meta">
    					<dl class="column">
    						<dt><?php _e('Start:', $spEvents->pluginDomain) ?></dt>
    							<dd><?php echo the_event_start_date(); ?></dd>
    						<?php if (the_event_start_date() !== the_event_end_date() ) { ?>
    							<dt><?php _e('End:', $spEvents->pluginDomain) ?></dt>
    							<dd><?php echo the_event_end_date();  ?></dd>
    						<?php } ?>
    						<?php if ( the_event_cost() ) : ?>
    							<dt><?php _e('Cost:', $spEvents->pluginDomain) ?></dt>
    							<dd><?php echo the_event_cost(); ?></dd>
    						<?php endif; ?>
    					</dl>
    					<dl class="column">
    						<?php if(the_event_venue()) : ?>
    						<dt><?php _e('Venue:', $spEvents->pluginDomain) ?></dt>
    							<dd><?php echo the_event_venue(); ?></dd>
    						<?php endif; ?>
    						<?php if( tec_address_exists( $post->ID ) ) : ?>
    						<dt><?php _e('Address:', $spEvents->pluginDomain) ?><br /><a class="gmap" href="<?php event_google_map_link() ?>" title="<?php _e('Click to view a Google Map', $spEvents->pluginDomain); ?>" target="_blank"><?php _e('Google Map', $spEvents->pluginDomain ); ?></a></dt>
    							<dd>
    							<?php tec_event_address( $post->ID ); ?>
    							</dd>
    						<?php endif; ?>
    					</dl>
    				</div>
    
    				<?php if( tec_address_exists( $post->ID ) ) event_google_map_embed(); ?>
    
                                    <?php if (function_exists('the_event_ticket_form')) { the_event_ticket_form(); } ?>		
    
    			</div><!-- .post -->
    
    		<?php if(eventsGetOptionValue('showComments','no') == 'yes'){ comments_template();} ?>
    
    	</div><!-- #tec-content -->
    
    <?php
    	get_footer();
    Thread Starter silvafer

    (@silvafer)

    Thanks.. but no luck… :-(((
    I am getting

    Fatal error: Call to undefined function tec_address_exists() in /web/htdocs/www.groshgrup.net/home/blog/wp-content/themes/atahualpa/events/single.php on line 35

    Please note that my events files had some modification to become atahualpa compliant… maybe this complicates the issue?

    (see this thread : http://wordpress.org/support/topic/357338/page/2?replies=36 )

    Let me know the results as you move forward.

    I like the calendar, wold also like ti to be on the bottom as my events are theatre, art, and music. My theme has a dynamic sidebar which is removed when I enable the plug-in as well as the CSS styling.

    I am looking through the rest of the forum to see if there are ways to customize.

    Thread Starter silvafer

    (@silvafer)

    No progress so far… :-(( it would be really good if the plugin had an option for choosing if events data and maps should be at the beginning of the post or at the end!!

    Still trying to move map and ticket info to bottom of post

    Azizur, Did you mean theme when you said template in your instruction

    My theme is MimboPro

    Thanks

    hello guys.
    did you find a solution for the above? because i want the same too?
    if you found anything please share.

    thank you.

    It works just like Azizur wrote.

    Cut and paste the code above into the single.php in the events plugin

    NOT into your THEME folder

    Glad to see this is not a closed question — as I’ve used the above code but end up with my template styling being killed by the plugin’s single.php — surely there is a way use only the event brite calendar data/tables but and not mix it with the template loop??

    Template tags solutions seems like a rather pieced together series of calls.

    So how do we use this code without inter-mixing it in the core loop which will kill the already styled template loop??? Rewriting the core loop seems to be the long way around when this is a plugin.

    It’s a fantastic plugin, but don’t think I can use it until it’s a more modular implementation process — unless someone can tell me if there a secret work around.

    kashann

    (@kashann)

    So moving the map below the content and ticket info is easy. Just use the method Azizur mentioned above.

    Putting the map in between the text and ticket box is going to be difficult, as the ticket box is added to the end of the_content() with a hook.

    I’ve been wrestling with this for a few days, because I’d like to add a bit more content above the Eventbrite Ticket box on every event. Kind of frustrating. I’m working on a fix, and will post it if I’m successful.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘[Plugin: The Events Calendar] Post content first, map and events details after…’ is closed to new replies.