Conditionals in non tribe loops, and functions…..

Home Forums Calendar Products Events Calendar PRO Conditionals in non tribe loops, and functions…..

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #940527
    Jacob Masters
    Participant

    I need to access the conditionals like tribe_is_event(); tribe_is_month() tribe_is_past() from custom post and tribe_events loops in my theme, as well as from functions.php to write a custom breadcrumb script, but none are working except within tribe event pages themselves, is there a global that needs registering or anything else i need to do to get the conditionals to work as they should?

    #940626
    Josh
    Participant

    Hey gabba,

    Thanks for reaching out to us!

    You should be able to use these functions as conditionals within your theme’s functions.php file. One thing to note, for the most part these functions are loop based. So, the functions will only return true when called within the loop.

    For more detail and a possible workaround, would you mind providing a snippet for what you’re trying to accomplish?

    Thanks!

    #940648
    Jacob Masters
    Participant

    within the events loop, or within a regular posts loop?

    Also with functions, i’m using a variation on this code:

    http://tri.be/using-conditionals-to-show-breadcrumbs-for-events-and-venues/

    but the conditionals are not returning anything, not even a false..

    #941350
    Josh
    Participant

    Hey gabba,

    These can be used within any loop really, “tribe_is_event()” can also be used outside of the loop if you pass a post ID to it so it will check if the associated post is an event. The other two are conditionals specifically for certain views of the main calendar page.

    If you’re noticing that nothing is being returned, try following the Themer’s Guide and copying the views > month > single-event.php file into your theme and try using the conditionals there. Within this file, if you use the “tribe_is_month()” conditional it should return true.

    Let me know if that works for you.

    Thanks!

    #983731
    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 ‘Conditionals in non tribe loops, and functions…..’ is closed to new replies.