Support

Home Forums Event Espresso Premium Event Grid Image Size

Event Grid Image Size

Posted: June 28, 2017 at 3:02 pm


tneumann

June 28, 2017 at 3:02 pm

I have read through a number of the forum posts and it is my understanding that the EventEspresso Grid View Add-On uses the default thumbnail size, from Media Settings in WordPress. As this is a site wide setting, I don’t want to change it, for fear of unwanted results on other pages / posts. I am using the Grid View Add-On in two places, one a grid-view based page of all workshops that are upcoming…I am happy with the image sizes there. I am also using the grid-view as a part of my home page. I have the layout exactly how I want it and I have used CSS in my child theme to size the images for each event displayed in the grid…all good there.

My issue is, on the home page only, I would like to display larger images in the grid (300 X 300 to be exact…the medium size). Is there a way I could make a second copy of the plugin, giving it an alternate name, and have that copy of the plugin use the medium size as its default?

Thanks,
Tim


Josh

  • Support Staff

June 29, 2017 at 2:19 pm

Hi Tim,

Instead of making a copy of the entire plugin, you can make a copy of the grid template’s espresso-grid-template.template.php and put the copy into your active WordPress theme’s folder. Then you make a few modifications to your copy:
1) at the top of the file after the line that has // Options you add this:

$frontpage_id = get_option( 'page_on_front' );
$this_page_id = get_the_id();

2) Then a bit further down in the file, you change this:
$feature_image_url = $post->EE_Event->feature_image_url();
to this:

if ( $this_page_id == $frontpage_id ) {
  $feature_image_url = $post->EE_Event->feature_image_url('medium');
} else {
  $feature_image_url = $post->EE_Event->feature_image_url();
}


tneumann

July 7, 2017 at 7:39 am

Makes complete sense and worked perfectly.

Thank you so much for your rapid and extremely helpful response!

Thanks,
Tim


tneumann

July 7, 2017 at 7:42 am

For anyone else reading this thread, the use of a child-theme made this update / customization very easy to do and I know that future updates to the plugin and / or the theme are safe (barring a change of variable names). I can’t recommend a child theme strongly enough…has made a huge difference over and over again.

The support post ‘Event Grid Image Size’ 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.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  tneumann 1 year, 10 months ago ago

Topic Tags

Notifications

This topic is: resolved
Do NOT follow this link or you will be banned from the site!