Skip to content

Instantly share code, notes, and snippets.

@gugaalves
Last active February 11, 2020 20:23
Show Gist options
  • Save gugaalves/b409bf32e617b0537f811c07730e4c8d to your computer and use it in GitHub Desktop.
Save gugaalves/b409bf32e617b0537f811c07730e4c8d to your computer and use it in GitHub Desktop.
[Plugin] TheEvents Calendar - Show default feature inside the tooltip if the event doesn't have a featured image (for monthly view only)
<?php
/**
* Please see single-event.php in this directory for detailed instructions on how to use and modify these templates.
*
* Override this template in your own theme by creating a file at:
*
* [your-theme]/tribe-events/month/tooltip.php
* @version 4.6.21
*/
?>
<script type="text/html" id="tribe_tmpl_tooltip">
<div id="tribe-events-tooltip-[[=eventId]]" class="tribe-events-tooltip">
<h3 class="entry-title summary">[[=raw title]]<\/h3>
<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>
[[ } else { ]]
<div class="tribe-events-event-thumb">
<img src="https://via.placeholder.com/300x200" alt="alternative image description" \/>
<\/div>
[[ } ]]
[[ if(excerpt.length) { ]]
<div class="tribe-event-description">[[=raw excerpt]]<\/div>
[[ } ]]
<span class="tribe-events-arrow"><\/span>
<\/div>
<\/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>
[[ } ]]
<h3 class="entry-title summary">[[=raw title]]<\/h3>
<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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment