Support

Home Forums Event Espresso Premium Grid Template shortcode changing display on different pages

Grid Template shortcode changing display on different pages

Posted: May 18, 2021 at 4:27 pm

Viewing 12 reply threads


pathwise

May 18, 2021 at 4:27 pm

On different pages, the grid template shortcode is displaying in different ways.
On some pages it shows up like this
Grid template on certain pages
Grid template on certain pages - hover

However, on other pages it shows up like this (which is what we prefer):
Grid template we prefer

Both pages are using the same Espresso Grid Template shortcode. The only difference is the category slug. This happens multiple times throughout the site. The settings, etc, are the same for all events and courses. Is there something I am missing?


Tony

  • Support Staff

May 19, 2021 at 5:13 am

Hi there,

Are you using a page builder on the site?

The first 2 images are the ‘correct’/default output for that shortcode.

The last screenshot is how the grid template will be output if its stylesheet isn’t loading on the page (common with page builders when EE can’t detect the shortcode has been used).

Can you link me to the pages I can take a look?


pathwise

May 19, 2021 at 10:31 am

Hi Tony,

I am not using a page builder, just Gutenberg blocks with WordPress.
I am using a Chrome Browser. And it is the same shortcode and page setup, the only difference is the category slug, so I am confused why it would change from page to page.

Here is one version: https://dev11.pathwisesolutions.com/course-descriptions/electrofishing-certification/

Here is another: https://dev11.pathwisesolutions.com/course-descriptions/avian-nest-sweeps-and-monitoring-methods/

And if you go to Courses, some of them are working and some are not. For example, https://dev11.pathwisesolutions.com/course-descriptions/amphibian-and-reptile-salvage-methods/ is showing how we would like – or what you say is broken code
Whereas, this one shows up the same as the Electrofishing does https://dev11.pathwisesolutions.com/course-descriptions/fish-habitat-restoration-certificate-program/


Tony

  • Support Staff

May 19, 2021 at 11:39 am

Are these newly created pages? The source shows genesis-page-builder in use on the site, I’m just checking these weren’t created previously using that?

To show you an example, the avian nest sweeps page, isn’t loading the event table view template assets: https://monosnap.com/file/GcJ8M1eqUqwP7jzNUFW77EUi5jQJ6Z

So you see the ‘unstyled’ elements.

Electrofishing does load the assets from the plugin: https://monosnap.com/file/dK9U2uhiB67OzcXbHhP7FZL78dh338

I’ve asked one of our developers for some feedback to see what I’m missing here, I can’t think of a reason for one page to load the styles and the other not if they’ve both been created in the same way (the category attribute on the shortcode shouldn’t have any effect).


pathwise

May 19, 2021 at 12:19 pm

We use Genesis as our theme, and so the pages would have been built using that from the get-go. But if this was the issue, it should have been happening on all pages, no?


Brent Christensen

  • Support Staff

May 19, 2021 at 1:22 pm

@pathwise

Hello neighbour (I’m in Parksville BC), I’m Event Espresso’s lead developer. I looked at your site and don’t see anything in the markup to indicate why some of those pages are functioning and some are not. There is also nothing in the template grid code that intentionally changes how things are displayed based on the page and/or category, etc.

That said, on some of your pages, the CSS and JavaScript assets are simply not loading but I do no know why. However, since you have stated that you prefer the versions where the assets have not loaded, then you could try the following code snippet to stop them from loading everywhere:


add_action(
	'wp_enqueue_scripts',
	function () {
		wp_deregister_style('espresso_grid_template');
		wp_deregister_script('espresso_grid_template');
	},
	11
);

I have not tested that but it should work. You simply need to place that somewhere on your site where you have other custom code. Tony can advise you better with how to do that if need be.


pathwise

May 19, 2021 at 1:27 pm

Hi Brent!

Thank you very much, I will try this and let you know how it works out. Very much appreciated.


pathwise

May 19, 2021 at 1:31 pm

Hi Brent,

I have tested this code, as well as cleared the site and browser cache. However, I am still seeing this issue happening on the aforementioned pages, for example the Electrofishing Certification page: https://dev11.pathwisesolutions.com/course-descriptions/electrofishing-certification/


Tony

  • Support Staff

May 19, 2021 at 2:21 pm

Hi,

May I ask where you added the code?

If you’ve added it to your theme’s functions.php file try using a custom functions plugin:

You can add that to a custom functions plugin on your site, we have some documentation on creating one here:

https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/


pathwise

May 19, 2021 at 2:38 pm

Hi Tony,

I have added it to the Simple Custom CSS and JS PRO plugin that we use on our sites.


Tony

  • Support Staff

May 20, 2021 at 6:14 am

Ah, ok, so then that’s why.

The code Brent gave you is PHP and the above plugin is for CSS and/or JS, right now it’s being added to the page as JavaScript.

Follow the link I added above to build a custom functions plugin and add the code to that, PHP needs to be processed server-side and not on the page itself within the browser like JS.


pathwise

May 21, 2021 at 9:48 am

Hi Tony & Brent!

I added this to the functions.php file and it worked!
Thank you so much for your help!


Tony

  • Support Staff

May 25, 2021 at 3:42 am

You’re most welcome, I’m glad its working for you 🙂

Viewing 12 reply threads

The support post ‘Grid Template shortcode changing display on different pages’ 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