Support

Home Forums Event Espresso Premium Change the theme template that the event posts display in

Change the theme template that the event posts display in

Posted: September 28, 2014 at 3:51 pm


Steve

September 28, 2014 at 3:51 pm

Hey!

So I am noticing that the event entries in EE4 display as blog posts. I want to camoflague this and make it appear as though they are not blog entries. Is it possible to create a second index.php file for only the EE events to display in? My php knowledge is fairly limited. Can I create a wordpress theme template just for single EE event entries? How would I go about telling EE where to find this theme template?


Lorenzo Orlando Caum

  • Support Staff

September 28, 2014 at 4:10 pm

Hi Steve,

There are two ways to adjust this:

1) You can use CSS and target single event pages to hide the post meta information (post date, author).

2) You can create a new theme template for Event Espresso.

For option two, a single-espresso_events.php will be needed.

Login to your WordPress root with your preferred SFTP or FTP client. FileZilla and Cyberduck are both free options.

Next browse to this location:

wp-content/themes/yourthemefolder

You should now be viewing the contents of your theme. Locate a page.php file and duplicate it.

Then rename to single-espresso_events.php.

Now open the file for editing. Towards the middle of the file, you should see a call for the content. Here is an example:


Change it to this and save changes:



Lorenzo


Steve

October 3, 2014 at 10:08 pm

I did as your instructions said, however I didn’t see this code in my template:

< ?php get_template_part( 'content', 'page' ); ?>

So I put this:

< ?php espresso_get_template_part( 'content', 'espresso_events' ); ?>

Where I thought it should go and it displayed as text in my template. The page header is working properly though and includes the event title in it.


Lorenzo Orlando Caum

  • Support Staff

October 4, 2014 at 2:51 pm

Hi,

That was an example from the default WP themes (WP twenty fourteen), however the principle is the same for other themes.

Are you seeing any lines of code that might be similar to that?


Lorenzo


Steve

October 4, 2014 at 6:49 pm

OKay I seemed to be able to get the Event description to show up, now how do I get the datetimes to display?


Lorenzo Orlando Caum

  • Support Staff

October 5, 2014 at 8:16 pm

That information should appear. What is the name of your theme?


Lorenzo


Steve

October 6, 2014 at 11:52 am

Well it isn’t appearing. You can see that in the screen cap: http://sandbox.bramongarciabraun.com/wp-content/uploads/2014/10/screencap.jpg Our theme is a custom one.


Steve

October 6, 2014 at 11:53 am

The theme name is BGBstudio 2


Lorenzo Orlando Caum

  • Support Staff

October 6, 2014 at 1:18 pm

Okay, lets go back to this:

https://eventespresso.com/topic/change-the-theme-template-that-the-event-posts-display-in/#post-121370

Could you upload the contents of that file to pastebin and then link to it here?


Lorenzo


Steve

October 6, 2014 at 4:05 pm

Sure: http://pastebin.com/3vex16ie


Josh

  • Support Staff

October 7, 2014 at 10:23 am

Hi Steve,

While I do not have a copy of your theme to test this, I can point you in the right direction. On line 13 of your template, where you have this:

<div class="clearfix"><?php the_content( 'content', 'espresso_events' ); ?></div>

It should be this instead:

<div class="clearfix"><?php espresso_get_template_part( 'content', 'espresso_events' ); ?></div>

Along with that, please be sure that the file name of your template matches this name exactly: single-espresso_events.php

The support post ‘Change the theme template that the event posts display in’ 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