• Resolved devg1ne

    (@devg1ne)


    Hi,

    I am having an issue whereas I have managed (after some trying and copying templates folder) to get the main events page to have the header overridden by my themes header override, however, this only works for the main events page and single event pages/posts still show the default header. There is no option to override in the event/post editor either. Basically I have a light site wide header, but need it to be dark on event pages set to post. It works when set to page, but then the page styling does not look too good.

    Can anyone help with this? Ive tried many options including changing from theme, but this messes up all my other pages where the default (light) header is displayed.

Viewing 4 replies - 1 through 4 (of 4 total)
  • timrv

    (@timrv)

    Hello,

    The full guide on how to use EM Templates on your theme can be found here: https://wp-events-plugin.com/documentation/using-template-files/

    EM uses the same header file header.php on your theme. WordPress allows theme to have multiple header files like: header-wide.php then from your template files you could do something like: <?php get_header(‘wide’); ?> to call your header.

    You could also create a file called single-event.php which would override the single.php which is the default template that EM uses for single events.

    Alternatively if you want to create custom headers for you Events List Page or other Pages, You could create a WordPress Page Template and select those as the template for the page and create a custom header. (https://developer.www.ads-software.com/themes/template-files-section/page-template-files/)

    Thread Starter devg1ne

    (@devg1ne)

    Thanks for the suggestions.

    I will try these out over the weekend and see what I can do. No matter what template I use for events, it does not seem to change currently. Didint want to do too much code editing either, as not to knock things out of sync site wide.

    Thread Starter devg1ne

    (@devg1ne)

    Just to get this straight.

      I create a file called single-event.php and store it in the EM templates folder?

      I then add the string <?php get_header(‘wide’); ?> (with my referred header filename in place of the “wide”)?

    If this is correct, then it does not work, as I’ve just done that.

    The full guide on how to use EM Templates on your theme can be found here:https://wp-events-plugin.com/documentation/using-template-files/

    I did this before I even asked the question, but all it did was allow me to display an event as a post rather than a page. Either way even when I use the “Override Header” option on my theme it still does not work.

    I’m using Visual Composer, with the Foundry theme, so I am normally able to override individual page/posts headers/footers easily from the dropdown below the editor. With EM this option does not work when you go to the events page or it’s child pages (categories, tags etc…) and the dropdown does not even appear at all in EM event posts page.

    Although this plugin seems very comprehensive and useful, to have to do so much just to display a varied header, compared to just selecting from a dropdown is a lot.

    Plugin Support angelo_nwl

    (@angelo_nwl)

    Hi,

    you can try the following steps:

    1. set your events page to Post under Events > Settings > Pages > Event Pages > Display events as =Post

    2. in your theme directory create “single-event.php” then edit ( you can also copy your single.php template but in the content area try step #3)

    3. try the following

    
    
    <?php get_header(); ?>
    
    <div <?php post_class(); ?>>
    	<?php do_action( 'ct_mission_news_page_before' ); ?>
    	<article>
    		<?php ct_mission_news_featured_image(); ?>
    		<div class='post-header'>
    			<h1 class='post-title'><?php the_title(); ?></h1>
    		</div>
    		
    		<div class="post-content">
    			<?php 
    			global $post;
    
    			$EM_Event = em_get_event($post->ID, 'post_id');
    			
    			//display feature image
    			echo   $EM_Event->output('#_EVENTIMAGE');
    			
    			//get only the feature image url 
    			echo $EM_Event->output('#_EVENTIMAGEURL');
    
    			//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>
    		
    	</article>
    	<?php comments_template(); ?>
    </div>
    <?php get_footer(); ?>
    
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Header issues on single event pages’ is closed to new replies.