Creating a new template for venues

Home Forums Calendar Products Events Calendar PRO Creating a new template for venues

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #70010
    Steve
    Participant

    So I have a bit of a tricky request…

    I’m wanting to create a new template for the venues. I’m a bit new to all this coding stuff, however with previous templates for pages – I have managed to collect all the posts from a certain category using the code:

    // The Query
    $args = array(
    ‘cat’ => 67,
    ‘orderby’ => ‘title’,
    ‘order’ => ‘ASC’,
    ‘posts_per_page’=>10,
    );
    $query = new WP_Query( $args );

    Obviously getting the certain category posts with the ID 67. I’m not exactly sure about what code I would use to get the venues. To make it more confusing, I was wondering if there was a way that I could have three different pages for the venues… So having a page for the museums, theatres etc…

    If this is impossible using the plugin then I will create separate posts, and build the pages myself – however then my question would be, how can I change the links in the events, to take readers to the correct venue pages/posts.

    And intriguing one I know. Can anyone help me out?

    Thank you

    Dulcie

    #70076
    Barry
    Member

    Hi Dulcie,

    That should certainly be possible. You would need to set the post_type argument correctly (for venues it is tribe_venue or you can refer to it with TribeEvents::VENUE_POST_TYPE) if you want to focus only venues.

    Splitting them into three views by venue type is a little more involved – without knowing how you are going to make this distinction it’s hard to offer any advice – but I’m afraid in any case we will really need to bow out and leave this sort of customization to you 🙂

    Good luck!

    #70099
    Steve
    Participant

    When you say refer to it with TribeEvents::VENUE_POST_TYPE, where do I refer to it?

    And do you mean replacing the ( ‘cat’ =>67, ) With ( ‘post_type’ => tribe_venue )

    Told you I was new to this *sigh, haha, very much appreciate the help!

    Dulcie

    #70124
    Barry
    Member

    Hi Dulcie,

    That’s ok, we definitely appreciate not everyone is familiar with coding for WordPress. That said, you’d really need to do some reading both in terms of the WordPress docs for WP_Query and PHP in general to be confident your work is going to be robust and reliable and do exactly what you want 🙂

    Basically though you could use TribeEvents::VENUE_POST_TYPE instead of ‘tribe_venues’ when setting the post_type argument – the advantage being if we change the name of the venue post type in the future your code should still work. However, if you’re uncomfortable with this just use ‘tribe_venues.’

    As we’re talking about a customization here, however, I’m afraid we’ll have to bow out and wish you luck – good luck!

    #981360
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Creating a new template for venues’ is closed to new replies.