Single post Navigation

Home Forums Calendar Products Events Calendar PRO Single post Navigation

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #14331
    Luke
    Member

    I’m using tribe_previous_event_link, which works great. However I need to be able to check if there is a link, first event, to hide the div that contains it.
    Can you help?

    #14456
    Rob
    Member

    Hey Luke. Sorry that this one slipped through the cracks. I’m not sure how to address this but I’ve asked our dev Jonah to take a look and chime in with what he can this afternoon.

    #14481
    Jonah
    Participant

    Hi Luke, I don’t quite understand your request. Can you provide more details and possibly an example?

    Thanks,
    Jonah

    #14507
    Luke
    Member

    Hi Jonah
    I need to test if tribe_previous_event_link exists. I’m looking to achive something like if ( has_tribe_previous_event_link() ) or possiblly if ( get_tribe_previous_event_link() ) or even if ( tribe_previous_event_link( $echo = false) ). Does that help?
    Many Thanks
    Luke

    #14532
    Jonah
    Participant

    Hi Luke, the link is always going to exist if there are adjacent events (an earlier and later dated event) to the current event. When you get to the latest event post you will not see a next event link and vise versa for the earliest event.

    The tribe_previous_event_link automatically echo’s the value if it exists. I searched for this function in the code and found that within it contains a call to get_event_link which you should be able to use as a conditional check.

    Try something like this:


    global $post;
    $tribe_ecp = TribeEvents::instance();
    $next = $tribe_ecp->get_event_link($post,'next',$anchor);
    $prev = $tribe_ecp->get_event_link($post,'previous',$anchor);
    if($next != '') {
    echo 'its not empty!';
    } else {
    echo 'its empty!';
    }

    #975523
    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 ‘Single post Navigation’ is closed to new replies.