Support

Home Forums Event Espresso Premium Create a new template for my event listing

Create a new template for my event listing

Posted: August 21, 2014 at 7:11 am


ali west

August 21, 2014 at 7:11 am

I’ve been trying to create a new template for my event listings but it keeps saying it can’t find it. I’ve put in in the plugin folder and the theme folder incase I’m missing something and also in its own folder within those directories. On my page I’ve got:

[EVENT_CUSTOM_VIEW template_name=”grid-view”]

Where should I put the grid-view template exactly as it’s not being found?

Thanks!


Lorenzo Orlando Caum

  • Support Staff

August 21, 2014 at 12:19 pm

Hi,

Did you follow these steps to get this setup?

https://eventespresso.com/wiki/custom-template-addon/#cel_custom


Lorenzo


ali west

August 25, 2014 at 6:48 am

yes i did (well i thought i did but it shows that it can’t find the template grid_view.) … incase i’ve not read it correctly where should the grid-view.php actually be found?
thanks!


Lorenzo Orlando Caum

  • Support Staff

August 25, 2014 at 8:13 am

Lets try another approach.

Are you creating a new template?

Or are you using an existing template and making changes and would like to save those changes so that they are not lost on a software update?


Lorenzo


ali west

August 25, 2014 at 9:59 am

i’m creating a new template…
thanks lorenzo


Josh

  • Support Staff

August 25, 2014 at 7:25 pm

Hi Ali,

If you’re creating a template from scratch, there’s a few extra steps that I’ll outline below. But first, the main custom view plugin checks for the template in folder_name/index.php.

So in your theme (ideally a child theme) you’ll add a new folder and name it grid-view. Then add your template file to this new folder and name it index.php.

In index.php you’ll need to include an add_action with a callback to your template’s main function. For grid-view this will look like:

add_action('action_hook_espresso_custom_template_grid-view','my_custom_template_grid_view');

function my_custom_template_grid_view(){

// template code and stuff goes here

}

Then you can load this template via shortcode on a page:

[EVENT_CUSTOM_VIEW template_name=”grid-view”]


ali west

August 26, 2014 at 4:05 am

hi josh
hooray it worked! i think i must have missed off a couple of bits in the callback but working brilliantly now. thanks so much 🙂
ali


Dean

August 26, 2014 at 4:13 am

Thanks for letting us know you got it working. Can we mark this as resolved?


ali west

August 26, 2014 at 4:17 am

yes please!

The support post ‘Create a new template for my event listing’ 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