Home › Forums › Calendar Products › Events Calendar PRO › How to hide the Google Calendar and Ical
- This topic has 3 replies, 2 voices, and was last updated 8 years, 10 months ago by
Jennifer.
-
AuthorPosts
-
June 6, 2017 at 6:16 am #1293684
dave
ParticipantDear Support,
All is working well. I just have a little question on how to hide the Google Calendar and Ical Export buttons. I was able to hide the meta and map for only members but can not see how to hide those buttons. (I am using Memberpress as the membership software. )
I created a single-event.php in my child themes and did the following.
<!– Event meta –>
<?php echo do_shortcode(“[mepr-login-link]”); ?>
<?php echo “<–Please login to see the location or to RSVP.”; ?>
<?php if(current_user_can(‘mepr-active’,’membership:9, 1023′)): ?>
<?php do_action( ‘tribe_events_single_event_before_the_meta’ ) ?>
<?php tribe_get_template_part( ‘modules/meta’ ); ?>
<?php do_action( ‘tribe_events_single_event_after_the_meta’ ) ?>
<?php endif; ?>This hide the meta and map, but it did not hide the buttons. I have been looking but can not see where the code is located for the buttons. Could one of you point me in the right direction?
Here is the link to the event (https://nyhfr.org/event/town-hall-style-meeting-congressional-representatives-claudia-tenney-thomas-suozzi/)
Thank you
DaveJune 6, 2017 at 2:45 pm #1294058Jennifer
KeymasterHi Dave,
Thanks for reaching out – I’m glad to hear the plugin is working out for you!
Are you trying to hide the buttons completely or conditionally based on whether or not someone is logged in? If you want to get rid of them altogether, we have a plugin for that! If you’d like to keep it simple, we also have a CSS solution.
You can find the function that generates them (single_event_links) here:
wp-content/plugins/the-events-calendar/src/Tribe/iCal.php
The buttons are displayed by hooking into
'tribe_events_single_event_after_the_content'.So if you want to display them conditionally, you can include this line
<?php do_action( 'tribe_events_single_event_after_the_content' ) ?>
in your if statement. Keep in mind though that if you have anything else hooked in there, the condition will apply to it as well. I took a quick look around, and it looks like the only other thing we have hooked in there would be the ticket/RSVP form if you have selected “Below the event description” for the location of the form (under Events > Settings > Tickets). Otherwise, you should be good!
I hope that helps! Please let me know if you have any more questions.
Thanks,
Jennifer
June 6, 2017 at 11:18 pm #1294244dave
ParticipantDear Jennifer,
Thank you, that solved the problem. Please close the ticket.
Dave.
June 7, 2017 at 8:03 am #1294424Jennifer
KeymasterGlad to hear that worked for you Dave! I’ll close this out, and please feel free to open a new one if you have any more questions.
Thanks,
Jennifer
-
AuthorPosts
- The topic ‘How to hide the Google Calendar and Ical’ is closed to new replies.
