Support

Home Forums Event Espresso Premium Events Grid View Template not working

Events Grid View Template not working

Posted: November 30, 2017 at 4:13 pm

Viewing 5 reply threads


markt521

November 30, 2017 at 4:13 pm

When I try to use the Events Grid View Template it is showing the code itself i had it one time showing them but it wasn’t in a grid it was in a straight line down.
http://www.mtc.me/ under the headline Trips & Products


Josh

  • Support Staff

November 30, 2017 at 4:57 pm

Hi there,

I checked your website and the shortcode you see there,
[EVENT_CUSTOM_VIEW template_name="grid" sort="ASC" order_by="start_date"]

is actually for the Event Espresso 3 event custom view add-on. You’ll need to use the Events Grid View Template add-ons shortcode instead. Here’s a link to the documentation that shows how to use that add-on:

https://eventespresso.com/wiki/events-grid-view-template-add-on/#ee4usage

The simplest form of the shortcode is as follows:

[ESPRESSO_GRID_TEMPLATE]


markt521

November 30, 2017 at 5:04 pm

Ok that is why it worked once then didn’t work when i was playing with it. Now I have that one back there and it is putting them in a line downwards and not in a grid.


Josh

  • Support Staff

November 30, 2017 at 5:41 pm

The reason for the layout issue is because the shortcode is being used within a widget area. The shortcode is really only intended to be used within the main content section of a page or post. You can work around that limitation by manually enqueueing the Grid add-on’s assets. Are you familiar with how to add a function to either the theme’s functions.php file or into a site specific plugin?


markt521

December 1, 2017 at 1:07 am

I can probably do either with instructions. Is it listed somewhere how to.


Josh

  • Support Staff

December 1, 2017 at 7:55 am

You add this code to your website:

add_action('wp_enqueue_scripts', 'mtc_add_grid_scripts_to_home_page', 11);
function mtc_add_grid_scripts_to_home_page() {
	if(is_front_page() && class_exists('EES_Espresso_Grid_Template')){
		add_action('wp_enqueue_scripts', array('EES_Espresso_Grid_Template', 'enqueue_scripts'), 12);
	}
}

You can add the above to a functions plugin or into your WordPress theme’s functions.php file. We recommend the plugin method so you won’t lose your changes when you update your WordPress theme.

Viewing 5 reply threads

The support post ‘Events Grid View Template not working’ 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