Support

Home Forums Event Espresso Premium Disable automatic injektion of excerpts and buttons

Disable automatic injektion of excerpts and buttons

Posted: May 13, 2015 at 8:13 am

Viewing 4 reply threads


tigerton

May 13, 2015 at 8:13 am

Hi.

I’ll give this another go. Previously I posted this thread: https://eventespresso.com/topic/ee-settings-overwrite-my-custom-templates/

But you don’t seem to get what my issue is. I template EE completely on my own only using some EE functions for rendering ticket selector etc. etc.
In the theme I have an archive-espresso_events.php which overrides EE default. Everything works fine. Except when it comes to the event-category archive. The content there is affected by the settings in General settings > templates. If I for example set “Display description” to none it removes my own the_excerpt().. EE also seem to add another “read more” button on its own as well as event contact information.

This is a really really not desired thing to do. I can understand how it would be good when using a shortcode or something to list events but for me who wants complete control over what displays it’s horrible. It’s also strange that it only happens on the event-category archive. Not the regular posttype archive.

I had a look around at the core files and came across this function event_content_or_excerpt in EEH_Event_View.helper.php which might be part of the issue? There’s also this function template_include in EED_Events_Archive.module.php.

Is it possible that your priority function somehow dismisses my own archive template for event-categories archives? Adding my own taxonomy-event-category.php does nothing btw.

Please help me with this and don’t dismiss it as something else again. I would consider this a bug.

Thanks,
Jonathan


Lorenzo Orlando Caum

  • Support Staff

May 13, 2015 at 4:27 pm

Hi Jonathan,

That does not sound like the expected behavior for the events category pages. I don’t think I understood that in your prior support post so sorry about that.

I’ve looked at events category pages on the latest version of Event Espresso on a default WP theme and I’m not seeing the duplicate elements that you mentioned.

What theme are you currently using?

Thanks


Lorenzo


tigerton

May 14, 2015 at 3:03 am

Hi,

I’m using a custom theme built from scratch. You can find the website here: http://kfsk.se/blog/event-category/digital-utveckling/

This is the loop that’s affected. As you can see there’s nothing strange going on here really.


<?php while(have_posts()): the_post(); ?>
					<article <?php post_class('article-item clearfix'); ?> id="event-<?php echo get_the_ID(); ?>">
						<?php 
				        $datetime_string = espresso_event_date('Ymd', '', $post->EVT_ID, false);
				        $datetime_object = new DateTime($datetime_string);
				        $month = date_i18n('M', strtotime($datetime_string));
						?>
						<div class="post-date">
							<span class="date"><?php echo $datetime_object->format("d"); ?></span>
							<span class="month"><?php echo $month; ?></span>
							<span class="week">vecka <?php echo $datetime_object->format('W'); ?></span>
							<span class="year"><?php echo $datetime_object->format("Y"); ?></span>
						</div>
						<div class="postcontent">
							<header class="event-header">
								<h2><a href="<?php echo get_permalink(); ?>"><?php the_title(); ?></a></h2>
								<?php $categories = get_the_terms($post->ID, 'espresso_event_categories'); ?>
								<?php if(!empty($categories)): ?>
										<?php foreach($categories as $category): ?>
											<a href="<?php echo get_term_link($category->term_id, 'espresso_event_categories') ?>" data-icon="T" class="event-cats"><?php echo $category->name; ?></a>
										<?php endforeach; ?>
								<?php endif; ?>
								<?php $venue = espresso_venue_address('inline',$VNU_ID,false); ?>
								<?php if($venue): ?>
									<div data-icon="J" class="event-address"><?php echo $venue; ?></div>
								<?php endif; ?>
							</header>
							<div class="entry">
								<?php the_excerpt(); ?>
								<?php espresso_view_details_btn( $post ); ?>
							</div>
						</div>
					</article>
				<?php endwhile; ?>
				<?php custom_espresso_pagination(); ?>


Josh

  • Support Staff

May 15, 2015 at 10:09 am

Hi Jonathan,

You can disable those by adding the following to your theme’s functions.php file:


function jdj_remove_ee_archive_excerpts() {
	remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100, 1 );
}

add_filter( 'the_excerpt', 'jdj_remove_ee_archive_excerpts', 99 );

If you want to pursue this issue further, please open up a github issue or pull request and someone from the dev team may be able to work with you on that.

As an aside, if you need to make a specific template for event category archives, the actual name of the file will be taxonomy-espresso_event-categories.php.


tigerton

May 18, 2015 at 4:58 am

Hi Josh,

This only half solves the issue so I’ll take your advice and post an issue on github instead 🙂

Viewing 4 reply threads

The support post ‘Disable automatic injektion of excerpts and buttons’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso