• Resolved dozza

    (@dozza)


    I’ve got your plug working nicely at here for which I have chosen a full width template.

    When I select an individual event such as this i’d like this to also display in full width template rather than the default, 2-col template that it is using. I can’t see where to specify this.

    Any suggestions? I’m using ‘The Cotton’ theme by Pexeto from Theme Forest here.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Unfortunately, it is not possible for the moment.
    If you are a developer or know a bit of coding, you can edit single.php file in your The Cotton theme folder and make changes there.
    You can find out if the post displayed is an event by using this code:

    global $post;
    if( $post->post_type == 'ai1ec_event' ) :
    echo "This is an event";
    else :
    echo "This is not an event";
    endif;

    You can also look for an action/filter that’s called when wordpress decides what template to use. (this is a lot better)

    Thread Starter dozza

    (@dozza)

    Yani

    Thanks for reply.

    My single.php file looks like this. Do you fancy proposing te modification?

    <?php
    /**
     * Single Post Template - this is the template for the single blog post.
     */
    get_header();
    
    if(have_posts()){
    	while(have_posts()){
    		the_post();
    		//get all the page data needed and set it to an object that can be used in other files
    		$pex_page=new stdClass();
    		$pex_page->subtitle=get_post_meta($post->ID, 'subtitle_value', true);
    		$pex_page->slider='none';
    		$pex_page->layout=get_opt('_blog_layout');
    		$pex_page->sidebar=get_opt('_blog_sidebar');
    
    		//include the before content template
    		locate_template( array( 'includes/html-before-content.php'), true, true );
    
    		//include the post template
    		locate_template( array( 'includes/post-template.php'), true, false );
    	}
    } 
    
    //include the comments template
    comments_template(); 
    
    //include the after content template
    locate_template( array( 'includes/html-after-content.php'), true, true );
    
    get_footer();   ?>

    Appreciate any help here.

    @dozza
    I’d like to provide the solution, but this modification is under our premium support. You either have to fill a support request here: http://theseednetwork.com/get-supported/website-support/
    or wait for the community here to provide a solution for you.

    The calendar view is rendered using the page.php template. Maybe if I could see the contents of page.php I could come up with a solution.

    Thread Starter dozza

    (@dozza)

    @josjo
    That’s a very kind offer:

    This is page.php from the Cotton template:

    <?php
    /**
     * Default page template - all the pages by default use this template unless another page template has been assigned.
     */
    get_header();
    
    if(have_posts()){
    	while(have_posts()){
    		the_post();
    		//get all the page data needed and set it to an object that can be used in other files
    		$pex_page=new stdClass();
    		$pex_page->subtitle=get_post_meta($post->ID, 'subtitle_value', true);
    		$pex_page->intro=get_post_meta($post->ID, 'intro_value', true);
    		$pex_page->slider=get_post_meta($post->ID, 'slider_value', $single = true);
    		$pex_page->slider_prefix=get_post_meta($post->ID, 'slider_name_value', true);
    		if($pex_page->slider_prefix=='default'){
    			$pex_page->slider_prefix='';
    		}
    		$pex_page->layout=get_post_meta($post->ID, 'layout_value', true);
    		if($pex_page->layout==''){
    			$pex_page->layout='right';
    		}
    		$pex_page->show_title=get_opt('_show_page_title');
    		$pex_page->sidebar=get_post_meta($post->ID, 'sidebar_value', $single = true);
    		if($pex_page->sidebar==''){
    			$pex_page->sidebar='default';
    		}
    		$pex_page->carousel=get_post_meta($post->ID, 'carousel_value', true);
    		$pex_page->carousel_title=get_post_meta($post->ID, 'carouselTitle_value', true);
    
    		//include the before content template
    		locate_template( array( 'includes/html-before-content.php'), true, true );
        	wp_reset_postdata();
        if($pex_page->show_title!='off'){?>
    
       	<h1 class="page-heading"><?php the_title(); ?></h1><hr/>
        <?php }
    
    the_content();
    	}
    }
    //include the after content template
    locate_template( array( 'includes/html-after-content.php'), true, true );
    
    get_footer();
    ?>

    I also think the page code in my previous post is for wrong single.php and the single.php code for Cotton theme is actually as follows:

    <?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('Β« Back to Events', $spEvents->pluginDomain); ?></a></span>
    				<h2 class="entry-title"><?php the_title() ?></h2>
    				<a class="ical" href="<?php bloginfo('home'); ?>/?ical=<?php echo $post->ID; ?>"><?php _e('iCal Import', $spEvents->pluginDomain) ?></a>
    				<?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_phone()) : ?>
    						<dt><?php _e('Phone:', $spEvents->pluginDomain) ?></dt>
    							<dd><?php echo the_event_phone(); ?></dd>
    						<?php endif; ?>
    						<?php if( tec_address_exists( $post->ID ) ) : ?>
    						<dt>
    							<?php _e('Address:', $spEvents->pluginDomain) ?><br />
    							<?php if( get_post_meta( $post->ID, '_EventShowMapLink', true ) == 'true' ) : ?>
    								<?php $mapArgs = array("f"=>"q","source"=>"s_q","geocode"=>""); ?>
    								<a class="gmap" href="<?php event_google_map_link( null, $mapArgs ) ?>" title="<?php _e('Click to view a Google Map', $spEvents->pluginDomain); ?>" target="_blank"><?php _e('Google Map', $spEvents->pluginDomain ); ?></a>
    							<?php endif; ?>
    						</dt>
    							<dd>
    							<?php tec_event_address( $post->ID ); ?>
    							</dd>
    						<?php endif; ?>
    					</dl>
    				</div>
    				<?php if( get_post_meta( $post->ID, '_EventShowMap', true ) == 'true' ) : ?>
    					<?php if( tec_address_exists( $post->ID ) ) event_google_map_embed(); ?>
    				<?php endif; ?>
    				<div class="entry">
    					<?php the_content(); ?>
    					<?php if (function_exists('the_event_ticket_form')) { the_event_ticket_form(); } ?>
    				</div>
    				<?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();

    However, I’m not concerned with the calendar view, it’s when you look at the full detail of a particular event that I’d like it displayed in full width.

    Appreciate it if you can use the above to suggest something πŸ™‚

    @dozza
    I think the first single.php you posted is the right one. The key I think is to change the values for $pex_page->sidebar and $pex_page->layout.

    The problem is I don’t know what the proper values should be and I have no way to find out since they are specific to the theme you are using.

    Below is an updated version of the first single.php. This is just a wild guess so be sure to keep the original single.php if it doesn’t work.

    <?php
    /**
     * Single Post Template - this is the template for the single blog post.
     */
    get_header();
    
    if(have_posts()){
    	while(have_posts()){
    		the_post();
    		//get all the page data needed and set it to an object that can be used in other files
    		$pex_page=new stdClass();
    		$pex_page->subtitle=get_post_meta($post->ID, 'subtitle_value', true);
    		$pex_page->slider='none';
    		if($post->post_type == 'ai1ec_event') {
    			$pex_page->layout='left';
    			$pex_page->sidebar='none';
    		} else {
    			$pex_page->layout=get_opt('_blog_layout');
    			$pex_page->sidebar=get_opt('_blog_sidebar');
    		}
    		//include the before content template
    		locate_template( array( 'includes/html-before-content.php'), true, true );
    
    		//include the post template
    		locate_template( array( 'includes/post-template.php'), true, false );
    	}
    } 
    
    //include the comments template
    comments_template(); 
    
    //include the after content template
    locate_template( array( 'includes/html-after-content.php'), true, true );
    
    get_footer();   ?>
    Thread Starter dozza

    (@dozza)

    @josjo

    Bingo! You star.

    Initially I got a php error, but after some digging around I found that the value for layout should be ‘full’ and not left. Now it works just as I’d hoped.

    The full code for single.php if anyoe else need it is therefore:

    <?php
    /**
     * Single Post Template - this is the template for the single blog post.
     */
    get_header();
    
    if(have_posts()){
    	while(have_posts()){
    		the_post();
    		//get all the page data needed and set it to an object that can be used in other files
    		$pex_page=new stdClass();
    		$pex_page->subtitle=get_post_meta($post->ID, 'subtitle_value', true);
    		$pex_page->slider='none';
    		if($post->post_type == 'ai1ec_event') {
    			$pex_page->layout='full';
    			$pex_page->sidebar='none';
    		} else {
    			$pex_page->layout=get_opt('_blog_layout');
    			$pex_page->sidebar=get_opt('_blog_sidebar');
    		}
    		//include the before content template
    		locate_template( array( 'includes/html-before-content.php'), true, true );
    
    		//include the post template
    		locate_template( array( 'includes/post-template.php'), true, false );
    	}
    } 
    
    //include the comments template
    comments_template(); 
    
    //include the after content template
    locate_template( array( 'includes/html-after-content.php'), true, true );
    
    get_footer();   ?>

    Many thanks again @josjo

    Hello,
    I installed the plugin on my site today.

    When you click on the type of calendar you want or you want to change the month, there is nothing that changes! This must be the ajax does not work, I think. But how?
    My calendar : http://www.bons-plans-voyage-new-york.com/calendrier/
    And I don’t know how to remove the sidebar and the adsense ad like this website : http://liverunway.com/calendar

    How to make it work?
    Thank you in advance

    Alex

    Richard

    (@richardgirling)

    Hi alexlesbonsplans:

    In order to keep the WordPress forum organized, please can you create a separate thread for this question or – better yet – email us your question at help@time.ly where we provide premium support.

    However, I can tell you that this looks like a theme conflict, so first thing to try would be (temporarily) switching themes to Twenty Eleven and seeing if this resolves the issue. If it does, then consult this support article: http://help.time.ly/customer/portal/articles/676565-my-wordpress-theme-has-a-conflict-with-the-ai1ec-what-can-i-do-

    Because the original question in this thread was resolved, I am now marking this thread as “resolved.”

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: All-in-One Event Calendar] Need Event Detail page full width?’ is closed to new replies.