Posted: May 18, 2021 at 4:27 pm
On different pages, the grid template shortcode is displaying in different ways. However, on other pages it shows up like this (which is what 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? |
|
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? |
|
Hi Tony, I am not using a page builder, just Gutenberg blocks with WordPress. 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 |
|
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). |
|
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? |
|
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:
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. |
|
Hi Brent! Thank you very much, I will try this and let you know how it works out. Very much appreciated. |
|
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/ |
|
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/ |
|
Hi Tony, I have added it to the Simple Custom CSS and JS PRO plugin that we use on our sites. |
|
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. |
|
Hi Tony & Brent! I added this to the functions.php file and it worked! |
|
You’re most welcome, I’m glad its working for you 🙂 |
|
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.