Support

Home Forums Event Espresso Premium Main events listing page is only displaying title and description for each event

Main events listing page is only displaying title and description for each event

Posted: January 9, 2019 at 2:43 pm


mireaux2019

January 9, 2019 at 2:43 pm

I read in order to set up a custom event listing page, copy your child theme’s archive.php to a new file called archive-espresso_events.php, so I did that. I removed all the blog stuff and added this to pull in the events: <?php echo do_shortcode(“[ESPRESSO_EVENTS]”); ?>

But even with that, it only shows title and description. It is missing the date, time, location, etc. Even though in Event Espresso -> Events -> Templates all that stuff is set to display Yes.

How do I get it to pull in the extra data? When I call [ESPRESSO_EVENTS] everywhere else on the website it shows everything it’s supposed to.


Josh

  • Support Staff

January 9, 2019 at 2:56 pm

You do not need to, and really shouldn’t, use do_shortcode in that template to query the events. Doing so will break the main query. If you use the standard WordPress loop code just like your theme’s archive.php template does, WP_Query will pull in the events.


mireaux2019

January 9, 2019 at 3:00 pm

Okay I put it back to what it was but now it’s back to looking like a blog post list instead of my event list, and it’s still just showing title and description.

How do I make it look like the result of [ESPRESSO_EVENTS] that are on my other pages?


Josh

  • Support Staff

January 9, 2019 at 3:02 pm

Since that’s controlled by the WordPress theme, it will help to see the relevant theme code. Maybe you can post a link to where I could download the theme?


mireaux2019

January 9, 2019 at 3:09 pm

This reply has been marked as private.


mireaux2019

January 9, 2019 at 3:14 pm

Hopefully you’re able to see the private reply with the link, not sure if that’s what that checkbox meant. Also here is a screenshot to what the page looks like right now: https://www.mireauxms.com/screenshot-2.png


Josh

  • Support Staff

January 9, 2019 at 7:16 pm

I took a look at the theme code and the reason the posts look like blog posts is because of the logic and elements in the mfn_content_post function. Buried deep in that function is the WordPress loop. Since that function is kind of a mess, it’s not really a viable to work with or use as a standard WordPress loop.

What you could do instead is just remove the BeTheme code from your child theme’s archive-espresso_events.php template:

$featured_image = '';	// all
if( $load_more ){
	$featured_image = 'no_slider';	// no 
slider if load more
}
if( mfn_opts_get( 'blog-images' ) ){
	$featured_image = 'image';	// images 
only option
}
echo mfn_content_post( false, false, $
featured_image );

and replace with:

espresso_get_template_part( 'loop', 'espresso_events' );

then, and this is essential, you’ll add this to your child theme’s functions.php file:

add_filter( 'FHEE__EED_Event_Archive__template_include__allow_custom_selected_template', '__return_true' );

While you’re editing the functions.php file, you can remove the function there that sets all-training-courses to be the events slug. Then instead, set the Event Slug option in Event Espresso > Events > Templates. Using the option is recommended so that if the theme is ever changed down the road, the custom event slug will remain.


mireaux2019

January 10, 2019 at 8:59 am

Thank you sooooo much! That fixed it.

I had tried to set Event Slug through Event Espresso > Events > Templates but our main WP permalink is website.com/blog/%postname% or something and so our event detail page URLS were turning into website.com/blog/all-training-courses/event-name. The point of the function was to remove /blog/….not sure if there was a better way to do that but it worked.

The support post ‘Main events listing page is only displaying title and description for each event’ 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