Support

Home Forums Event Espresso Premium Related Events – and where it can be located

Related Events – and where it can be located

Posted: October 16, 2018 at 3:04 pm


scaldwell

October 16, 2018 at 3:04 pm

I’ve followed the instructions on this page: https://eventespresso.com/wiki/adding-related-events-using-advanced-custom-fields/

And wanted to put the Related Events into a sidebar – but when we tried it – the ticket selector shows up in the sidebar too.

Can we separate them?

Looks like its paired with this: event is coming to calling this :

add_action( ‘AHEE_event_details_after_the_content’, ‘ee_related_events’ );

Can we separate this out?
Thanks Team!
Shelly


Josh

  • Support Staff

October 16, 2018 at 3:18 pm

Hi Shelly,

You’ll likely need either a different hook to get the list into the sidebar, and the first thing to check is whether the WordPress theme you’re using has a hook available there.

May I ask is there a custom template for the page or is it the stock theme template? If the latter, is this a theme I can download somewhere so I can find out more information?


scaldwell

October 16, 2018 at 3:26 pm

It’s a custom theme. Could we have it twice on the page and hide one of them with css?


Josh

  • Support Staff

October 16, 2018 at 3:38 pm

You probably don’t need to use the hook if it’s a custom theme. Instead, you could put the code directly into the template or into a custom sidebar template. For example, this could go directly into the template instead:

<?php
$relevents = get_field('events');

if( $relevents && is_singular( array( 'espresso_events') ) ): ?>
	<div class="related-events">
	<h3 class="event-venues-h3 ee-event-h3">Related Events</h3>
	<ul>
		<?php foreach( $relevents as $relevent ): ?>
			<li>
				<a href="<?php echo get_permalink( $relevent->ID ); ?>">
					<?php echo get_the_title( $relevent->ID ); ?>
				</a>
			</li>
		<?php endforeach; ?>
	</ul>
	</div>
<?php endif; ?>


scaldwell

October 16, 2018 at 3:39 pm

Cool. I will try that! THanks Josh!

The support post ‘Related Events – and where it can be located’ 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