Support

Home Forums Event Espresso Premium EE4 Template part

EE4 Template part

Posted: February 24, 2015 at 1:31 pm


devjenifer

February 24, 2015 at 1:31 pm

Hi,

Help for a non-coder using EE4.

I need to place a template tag on a custom page that will list up to the latest three events showing only the event name, the date/time and register button.

Here is what I tried:

<?php espresso_get_template_part (‘content, espresso_events’) ?>

I know this is too broad, how do I filter out everything but, date/time, title, and register button.

Thanks


Lorenzo Orlando Caum

  • Support Staff

February 24, 2015 at 1:53 pm

Hi Jenifer,

You could combine the body class from the page along with an ESPRESSO_EVENTS shortcode. Then combine that body class with certain elements from Event Espresso along with display none.

This tutorial has an overview of how to find the CSS class or IDs of Event Espresso elements:

https://eventespresso.com/wiki/hide-certain-elements-event-espresso-pages-using-css/

Take a look at the article above.

Then add this shortcode to a WP page:

[ESPRESSO_EVENTS limit=”3″]

Then you can inspect certain elements an add the CSS to your child theme or a plugin like My Custom CSS or Reaktiv CSS Builder.

.page-123 .customclasshere, .page-123 .customclasshere2 {display:none;}

That will allow you to hide those elements on just this page and they can easily be reversed. Additionally, you won’t need to make any changes to any templates.


Lorenzo


devjenifer

February 24, 2015 at 2:12 pm

Thanks Lorenzo. That is the solution I am considering, I thought there may be a different way of handling this–I guess I’m such a non-coder after all. Will let you know if I need anything further


Lorenzo Orlando Caum

  • Support Staff

February 24, 2015 at 3:36 pm

Hi, that is actually easier than trying to edit the template files. Also, if you edit the template files, then those will apply sitewide instead of just to the specific page that you are wanting to show 3 events on.


Lorenzo

The support post ‘EE4 Template part’ 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