If Is Events Calendar

Home Forums Calendar Products Events Calendar PRO If Is Events Calendar

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #68459
    Scott
    Participant

    I have a few questions:

    1) I want to be able to turn on/off other divs on the page that uses Events Calendar Pro, be it Calendar View, or Single Event View, etc. What I am looking for, but am unable to find, is something similar to the way WordPress would check to see if the page is using a custom post type i.e.

    if ( ‘tribe_events’ == get_post_type() ) { /* DO SOMETHING */ } else { /* DO SOMETHING ELSE */ }

    Is there also a way to do this by template type i.e. “is event single”, “is list view”, etc?

    2) Google Calendars are not working on single events, there is a javascript error that says “Syntax Error”. What appears to be happening is that on the single event, there is an automatic wrapping of paragraph tags around items, so it is putting the paragraph in the javascript, causing it to break. How would I tell it to get the content without auto-adding paragraph tags? I believe it has something to do with how Events Calendar Pro uses the_content(); on the specified template to pull in content, as when I used echo get_the_content(); all I got back was the actual text, and no calendar, image, date, title, etc.

    #68566
    Barry
    Member

    Hi Scott,

    It would be great if you could break that second issue out in to a thread of its own, but we can look at the first question here 🙂

    We do have a number of functions that can be used as the basis of conditional statements which might be of interest here:

    tribe_is_event_query()
    tribe_is_event()
    tribe_is_month()
    tribe_is_week()
    …and more!…

    Do those help here?

    #68581
    Scott
    Participant

    That really, really helps! I always get confused going into the documentation, so I wasn’t sure what to do with that. I know it would take some work, but it would be great if at some point the documentation could have some examples in it? I feel that might help reduce some Support threads too!

    As for the second question, I created a thread here – https://tri.be/support/forums/topic/wpautop-remove-for-single-event/

    Thanks for your assistance!

    #68583
    Scott
    Participant

    You know what, forget that second thread, and remove it from the system (burn it if you want). I did more searching and found a weird function that seemed to be freaking out with the plugin, as soon as I removed the function it started working.
    One thing I would like to know that kind of goes with both of these; is there a “custom post type” that could be called? I thought it would have been “tribe_events” but it doesn’t appear to be that easy.
    Thanks for all your help!

    #68606
    Barry
    Member

    I know it would take some work, but it would be great if at some point the documentation could have some examples in it?

    Absolutely 🙂

    I can promise you our intention is indeed to bulk up the documentation and in a sense make it more “user friendly” – but it is taking a little more time than is perhaps ideal. Please bear with us though – we’ll get there!

    I thought it would have been “tribe_events” but it doesn’t appear to be that easy.

    That is indeed the event post type name and it can also be accessed using a class constant, the advantage of doing so being that if we change the post name at some future point the class constant will ensure your code continues to work:

    $post_type = TribeEvents::POSTTYPE;

    However, using a string literal like ‘tribe_events’ should also work, so if you’re hitting problems it might be worth considering if you are doing whatever you are doing too early, before in fact the event post type is registered. Are you able to share your code and we can take a peek?

    (If so, please use a service like Pastebin or Gist rather than posting directly into the forum.)

    #981213
    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 6 posts - 1 through 6 (of 6 total)
  • The topic ‘If Is Events Calendar’ is closed to new replies.