Single Venue Template override

Home Forums Calendar Products Events Calendar PRO Single Venue Template override

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #32404
    Luke
    Participant

    Hi, I’ve noticed the single venue page uses the events template to display the information…
    I’ve tried the following to overwrite the template:
    single-tribe_venue.php
    archive-tribe_venue.php
    Either of these work, is there anyway to override the single venue template?

    #32414
    Barry
    Member

    Yes, using template overrides. In essence, you create an events directory within your theme – in this case you’d place single-venue.php in there.

    You can find the original (if you want to use the existing template code as a starting point) in events-calendar-pro/views/single-venue.php.

    Does that help?

    #32446
    Luke
    Participant

    Barry, that wasn’t really the question. I’ve already done that.
    The single-venue.php template is wrapped in a template choosen via the ui and it is the template for the events. I want venue list to be wrapped in its own template

    #32452
    Barry
    Member

    Sorry for the misunderstanding.

    The easiest way would be to use the same wrapper template, whether that’s ecp-single-template.php or something else, and insert a conditional statement to detect if the view is for a single venue (and load a different template from there if so).

    Depending on what you’re comfortable with you could alternatively filter the selection of template using tribe_events_template_ecp-single-template.

    Does that help?

    #32453
    Luke
    Participant

    Thanks Barry.

    I used this inside the main template, works a charm, I was just worried about server load:
    $ptype = get_post_type( $post->ID )
    if( $ptype == “tribe_venue” ) :

    #32459
    Barry
    Member

    I wouldn’t be too worried about server load, but if it is a real concern you could consider using the filter approach to dictate which template is loaded right off the bat.

    In any case, so long as you’ve got a working solution you’re happy with that’s the main thing 🙂 … but let me know if there’s anything else we can help with.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Single Venue Template override’ is closed to new replies.