Support

Home Forums Event Espresso Premium Single Page Template

Single Page Template

Posted: July 10, 2019 at 10:49 am


Matt & Cindra McCoy

July 10, 2019 at 10:49 am

Hello,
I recently changed themes (from a child theme, Swell Lite to Virtue by Kadence). I previously had customized single event templates, but I cannot get them to load. I have copied single-espresso_events.php to my theme folder, but the changes I have made are not showing up. Also, the feature image is not appearing in the single event page, although I have changed the blog post settings to show feature images. Can you please advise? Thank you.


Josh

  • Support Staff

July 10, 2019 at 10:55 am

Hi,

You can install this plugin to find out which template is getting loaded for the single event page:

https://wordpress.org/plugins/show-current-template/

May I ask does your single-espresso_events.php (or single.php) template include a call to the_post_thumbnail() or a similar function?

https://developer.wordpress.org/reference/functions/the_post_thumbnail/


Matt & Cindra McCoy

July 10, 2019 at 11:43 am

Thanks, Josh. The template that the single event page is using is base.php, but I can’t change that without altering the other pages on the site. I thought that the single event pages were custom post pages. Can you please tell me how I can this to load a custom single event page? Thanks.


Josh

  • Support Staff

July 10, 2019 at 11:59 am

Event Espresso events are custom post types. May I ask does the Virtue by Kadence have documentation related to custom templates or does it even support custom post type templates?

What you may need to do is add your changes to base.php and wrap them in conditionals so they only affect the event page.

e.g.

if(get_post_type() == 'espresso_events') {
  // add custom php code for events here
}


Matt & Cindra McCoy

July 10, 2019 at 12:57 pm

Thanks. The main thing I need to do is add a border around the single event page and post the feature image. Everything else is fine. In the previous template, this was done through the stylesheet. I’m not sure why the same stylesheet isn’t working, since most of the elements are specific to Espresso Event Calendar. The snippet below does not work, for example.
/* Add border to events on custom events page */
article.espresso_events {padding:10px; border:3px solid #000000 !important;}


Josh

  • Support Staff

July 10, 2019 at 1:09 pm

Your new theme might not use article in its html. Can you share a link to the page in question so we can take a look at its html?


Matt & Cindra McCoy

July 10, 2019 at 1:14 pm

I don’t think it does, but I’m not sure how I should rename it. Here is a link:
https://www.artnookaiken.com/eat-drink-art/


Josh

  • Support Staff

July 10, 2019 at 1:22 pm

Are we looking at the same thing? The reason I ask is because that page has a border around each event and a featured image too. Here’s a screenshot:

https://slack-files.com/T02SY781D-FL494TS0H-01d11c1ebf


Matt & Cindra McCoy

July 10, 2019 at 1:56 pm

The calendar view page is rendering correctly. It is the single event page that I’m trying to fix:
https://www.artnookaiken.com/wp-content/uploads/2019/07/single-event-page.jpg


Josh

  • Support Staff

July 10, 2019 at 2:08 pm

For what it’s worth, it’s best to just share a link to the page you need help with.

In this case, for the other page you could add this CSS:

.single-espresso_events .entry-content {
  padding:10px; border:3px solid #000000;
}

You must be logged in to reply to this support post. Sign In or Register for an Account

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: publish

Updated by  Josh 1 week, 1 day ago ago

Topic Tags

Notifications

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