Skip to content

Instantly share code, notes, and snippets.

@nefeline
Last active June 2, 2018 20:40
Show Gist options
  • Save nefeline/257922317fb34b84dd3e6655be91f0a1 to your computer and use it in GitHub Desktop.
Save nefeline/257922317fb34b84dd3e6655be91f0a1 to your computer and use it in GitHub Desktop.
This template wraps the content of the month view tooltip with an event link
<?php
/**
* This template wraps the content of the month view tooltip with an event link (the entire tooptip links to your event, not just the excerpt links).
*
* Add this template on:
*
* [your-theme]/tribe-events/month/tooltip.php
*/
?>
<script type="text/html" id="tribe_tmpl_tooltip">
<div id="tribe-events-tooltip-[[=eventId]]" class="tribe-events-tooltip">
<a href="[[=permalink]]">
<h4 class="entry-title summary">[[=raw title]]</h4>
<div class="tribe-events-event-body">
<div class="tribe-event-duration">
<abbr class="tribe-events-abbr tribe-event-date-start">[[=dateDisplay]] </abbr>
</div>
[[ if(imageTooltipSrc.length) { ]]
<div class="tribe-events-event-thumb">
<img src="[[=imageTooltipSrc]]" alt="[[=title]]" />
</div>
[[ } ]]
[[ if(excerpt.length) { ]]
<div class="tribe-event-description">[[=raw excerpt]]</div>
[[ } ]]
<span class="tribe-events-arrow"></span>
</div>
</a>
</div>
</script>
<script type="text/html" id="tribe_tmpl_tooltip_featured">
<div id="tribe-events-tooltip-[[=eventId]]" class="tribe-events-tooltip tribe-event-featured">
[[ if(imageTooltipSrc.length) { ]]
<div class="tribe-events-event-thumb">
<img src="[[=imageTooltipSrc]]" alt="[[=title]]" />
</div>
[[ } ]]
<h4 class="entry-title summary">[[=raw title]]</h4>
<div class="tribe-events-event-body">
<div class="tribe-event-duration">
<abbr class="tribe-events-abbr tribe-event-date-start">[[=dateDisplay]] </abbr>
</div>
[[ if(excerpt.length) { ]]
<div class="tribe-event-description">[[=raw excerpt]]</div>
[[ } ]]
<span class="tribe-events-arrow"></span>
</div>
</div>
</script>
@bregunec
Copy link

Hello
Could not you explain. I need to create a folders in the directory www/wp-content/thems/[your-theme]/tribe-events/month
and add file tooltip.php (add your code in file) ? I do this steps, but does not work.

I do something wrong?

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment