Home › Forums › Calendar Products › Events Calendar PRO › Single post Navigation
- This topic has 5 replies, 4 voices, and was last updated 8 years, 10 months ago by Support Droid.
-
AuthorPosts
-
January 29, 2012 at 3:05 am #14331LukeMember
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?January 31, 2012 at 10:46 am #14456RobMemberHey 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.
January 31, 2012 at 3:21 pm #14481JonahParticipantHi Luke, I don’t quite understand your request. Can you provide more details and possibly an example?
Thanks,
JonahFebruary 1, 2012 at 3:23 am #14507LukeMemberHi 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
LukeFebruary 1, 2012 at 10:23 am #14532JonahParticipantHi 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!';
}
July 4, 2015 at 5:00 pm #975523Support DroidKeymasterThis 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. -
AuthorPosts
- The topic ‘Single post Navigation’ is closed to new replies.