Custom events template only working with theme handling deactivated?

WordPress Event Management, Calendars & Registration Forums General Question Custom events template only working with theme handling deactivated?

This topic contains 1 reply, has 2 voices, and was last updated by  Stephen Harris 8 years, 1 month ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #25584

    Hi,

    I followed your tutorial to set up a custom events list template, using method 3 (‘like a pro’):

    https://wp-event-organiser.com/blog/tutorial/creating-your-own-events-page/

    While steps 1-2 work fine, step 3 (Choosing a template) does some weired things. When having the plugin setting Templates >> Theme handling on, the template_include filter remains without any effect.
    That means, the default template is used instead of my custom template. However, when I echo the template variable right before the return statement in my_custom_events_page_template function, the correct template path is displayed.

    In your tutorial, there’s no hint which says, template handling must be switched off to use custom event templates, is there?

    So, how to get my custom template get used, with the respective query variable in the URL?

    Thanks,
    Ron

    Ron
    #25599

    Hi Ron,

    That tutorial is about creating your own custom page – and the templating options are independent of any setting in Event Organiser. template_include is a WordPress filter and will always fire.

    So, your my_custom_events_page_template() is being triggered (as it should be). As for why this is not having an effect there could be one or two reasons for this:

    1. You’re not returning the template file path in the function
    2. Another plug-in/theme is over-riding your setting

    You can assign a larger number than 20 to give it higher priority to overcome (2). It maybe worth trying to find out what is over-riding your template location (and why) – there is a plugin called Query Monitor which is useful for this.

    Stephen Harris
Viewing 2 posts - 1 through 2 (of 2 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.