{"id":1950969,"date":"2021-09-29T04:13:02","date_gmt":"2021-09-29T08:13:02","guid":{"rendered":"https:\/\/theeventscalendar.com\/knowledgebase\/?post_type=tribe-knowledgebase&#038;p=1950969"},"modified":"2026-04-02T16:59:06","modified_gmt":"2026-04-02T20:59:06","slug":"display-venue-in-the-month-view-tooltip","status":"publish","type":"post","link":"https:\/\/theeventscalendar.com\/knowledgebase\/display-venue-in-the-month-view-tooltip\/","title":{"rendered":"Display Event Venue in the Month View Tooltip"},"content":{"rendered":"\n<p>In this tutorial we will walk through the steps you need to take if you want to include the venue data in the Month view tooltip. The foundation for this can be found in the <a href=\"https:\/\/theeventscalendar.com\/knowledgebase\/k\/how-to-include-a-new-template-in-a-view\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u201cUsing Template Filters and Actions\u201d<\/a> article.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2021\/09\/tec-month-view-tooltip-default.jpg\" alt=\"\" class=\"wp-image-1950970\"\/><figcaption>Month view tooltip<\/figcaption><\/figure>\n\n\n\n<p>First, we will need to create a file that holds the venue data we want to display. Then we will need to use a template filter to include that file in the tooltip.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-the-file\">The File<\/h2>\n\n\n\n<p>Let&#8217;s create a new file in your child theme at this location:<code>[your-theme]\/tribe\/events\/v2\/month\/tooltip-event-venue.php<\/code>:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;?php\n\/**\n * Get the venue ID.\n * @var integer $venue_id\n *\n * @see https:\/\/docs.theeventscalendar.com\/reference\/functions\/tribe_get_venue_id\/\n *\/\n$venue_id = tribe_get_venue_id();\n\nif ( isset( $venue_id ) &amp;&amp; $venue_id != 0 ) {\n\n\t\/**\n\t * Retrieving the venue object.\n\t * @var object $venue\n\t *\n\t * @see https:\/\/docs.theeventscalendar.com\/reference\/functions\/tribe_get_venue_object\/\n\t *\/\n\t$venue = tribe_get_venue_object( $venue_id );\n\n\techo &#039;&lt;div class=&quot;tribe-events-calendar-month__calendar-event-tooltip-venue tribe-common-b3&quot;&gt;&lt;p&gt;&#039;;\n\n\techo &#039;&lt;strong&gt;Venue:&lt;\/strong&gt; &#039;;\n\n\t\/\/ Display venue name\n\techo $venue-&gt;post_title;\n\n\t\/\/ Display venue address\n\tif ( ! empty( $venue-&gt;address ) ) {\n\t\techo &#039;, &#039; . esc_html( $venue-&gt;address );\n\t}\n\n\t\/\/ Display venue city\n\tif ( ! empty( $venue-&gt;city ) ) {\n\t\techo &#039;, &#039; . esc_html( $venue-&gt;city );\n\t}\n\n\techo &#039;&lt;\/p&gt;&lt;\/div&gt;&#039;;\n}\n\n<\/pre><\/div>\n\n\n<p>The template above checks if a venue for the event exists and if it does, then prints the venue name and the venue city.<\/p>\n\n\n\n<p>It is possible to adjust or expand this information depending on what you would like to display. You can find all the venue-related information and variables in <a href=\"https:\/\/docs.theeventscalendar.com\/reference\/functions\/tribe_get_venue_object\/#return\" target=\"_blank\" rel=\"noreferrer noopener\">this developer documentation<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-the-hook\">The Hook<\/h2>\n\n\n\n<p>To make all this information show up you will need to include this new template to show in the tooltip after (for example) the title for the month view. Copy the following code in your <em>functions.php<\/em> file:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nadd_action(\n\t&#039;tribe_template_after_include:events\/v2\/month\/calendar-body\/day\/calendar-events\/calendar-event\/tooltip\/title&#039;,\n\tfunction ( $file, $name, $template ) {\n\t\t$template-&gt;template( &#039;month\/tooltip-event-venue&#039; );\n\t},\n\t10,\n\t3\n);\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-a-detour\">A Detour<\/h2>\n\n\n\n<p>Of course, it is possible to put this information in a different place. For that, the appropriate hook needs to be used. <\/p>\n\n\n\n<p>If you look at the hook closely you will discover that it mimics the location of the template files. Let&#8217;s dissect that a bit.<\/p>\n\n\n\n<p>We are using this hook:<\/p>\n\n\n\n<p><code>tribe_template_<strong>after_include<\/strong>:events\/v2\/month\/calendar-body\/day\/calendar-events\/calendar-event\/tooltip\/title<\/code><\/p>\n\n\n\n<p>The &#8220;after_include&#8221; defines that what we are going to insert our new information after the named template. You could also use &#8220;before_include&#8221; if that&#8217;s what you need.<\/p>\n\n\n\n<p>The long string &#8220;v2\/month\/&#8230;\/title&#8221; actually refers to a PHP file in that folder of the plugin, namely:<\/p>\n\n\n\n<p><code>wp-content\/plugins\/the-events-calendar\/src\/views\/v2\/month\/calendar-body\/day\/calendar-events\/calendar-event\/tooltip\/title.php<\/code><\/p>\n\n\n\n<p>Let&#8217;s say you wanted to include the venue information after the event description. The description uses this template:<\/p>\n\n\n\n<p><code>wp-content\/plugins\/the-events-calendar\/src\/views\/<strong>v2\/month\/calendar-body\/day\/calendar-events\/calendar-event\/tooltip\/description.php<\/strong><\/code><\/p>\n\n\n\n<p>So the corresponding hook would be:<\/p>\n\n\n\n<p><code>tribe_template_after_include:events\/<strong>v2\/month\/calendar-body\/day\/calendar-events\/calendar-event\/tooltip\/description<\/strong><\/code><\/p>\n\n\n\n<p>Let&#8217;s get back on track now.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-customizing-the-appearance\">Customizing the Appearance<\/h2>\n\n\n\n<p>Starting with version 5.0 of The Events Calendar\u2019s views, any non-default elements that you add will be unstyled, allowing you full freedom to customize their display without worrying about style conflicts.<\/p>\n\n\n\n<p>The example above includes some basic classes for formatting. To further style the venue in the month view tooltip, we will need to include a couple of CSS rules into the <code>styles.css<\/code> file\u2013or any CSS file that will be included on an Events page\u2013in our theme.<\/p>\n\n\n\n<p>For this newly added venue I would give a bit more space to breathe at the bottom with the following CSS:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: css; title: ; notranslate\" title=\"\">\n.tooltipster-base.tribe-events-tooltip-theme .tribe-events-calendar-month__calendar-event-tooltip-venue {\n\tmargin-bottom: var(--tec-spacer-0);\n}\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-the-result\">The Result<\/h2>\n\n\n\n<p>When the steps above are complete and you have an event with the correct fields you should be able to see the venue data in the month view tooltip.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2021\/09\/tec-month-view-tooltip-with-venue.jpg\" alt=\"\" class=\"wp-image-1950971\"\/><figcaption>Month view tooltip with venue information<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial we will walk through the steps you need to take if you want to include the venue data in the Month view tooltip. The foundation for this can be found in the \u201cUsing Template Filters and Actions\u201d article. First, we will need to create a file that holds the venue data we&#8230;<\/p>\n","protected":false},"author":3,"featured_media":1955565,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_swpsp_post_exclude":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"ep_exclude_from_search":false,"footnotes":""},"categories":[24,59,79,84,97],"tags":[20,23,25,58,96],"stellar-product-taxonomy":[161],"class_list":["post-1950969","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-customizing","category-php-function-snippets","category-snippets","category-theming-overview","category-venues-organizers","tag-code","tag-css","tag-customizations","tag-php","tag-venues","stellar-product-taxonomy-the-events-calendar"],"acf":[],"taxonomy_info":{"category":[{"value":24,"label":"Customizations"},{"value":59,"label":"PHP Functions &amp; Snippets"},{"value":79,"label":"Snippets"},{"value":84,"label":"Templating &amp; Layout"},{"value":97,"label":"Venues &amp; Organizers"}],"post_tag":[{"value":20,"label":"Code"},{"value":23,"label":"CSS"},{"value":25,"label":"Customizations"},{"value":58,"label":"PHP"},{"value":96,"label":"Venues"}],"stellar-product-taxonomy":[{"value":161,"label":"The Events Calendar"}]},"featured_image_src_large":["https:\/\/images.theeventscalendar.com\/kb\/uploads\/2023\/02\/social-share-1024x538.png",1024,538,true],"author_info":{"display_name":"Jaime Marchwinski","author_link":"https:\/\/theeventscalendar.com\/knowledgebase\/author\/jaimetri-be\/"},"comment_info":0,"category_info":[{"term_id":24,"name":"Customizations","slug":"customizing","term_group":0,"term_taxonomy_id":24,"taxonomy":"category","description":"","parent":0,"count":157,"filter":"raw","term_order":"0","cat_ID":24,"category_count":157,"category_description":"","cat_name":"Customizations","category_nicename":"customizing","category_parent":0},{"term_id":59,"name":"PHP Functions &amp; Snippets","slug":"php-function-snippets","term_group":0,"term_taxonomy_id":59,"taxonomy":"category","description":"","parent":24,"count":127,"filter":"raw","term_order":"0","cat_ID":59,"category_count":127,"category_description":"","cat_name":"PHP Functions &amp; Snippets","category_nicename":"php-function-snippets","category_parent":24},{"term_id":79,"name":"Snippets","slug":"snippets","term_group":0,"term_taxonomy_id":79,"taxonomy":"category","description":"","parent":0,"count":80,"filter":"raw","term_order":"0","cat_ID":79,"category_count":80,"category_description":"","cat_name":"Snippets","category_nicename":"snippets","category_parent":0},{"term_id":84,"name":"Templating &amp; Layout","slug":"theming-overview","term_group":0,"term_taxonomy_id":84,"taxonomy":"category","description":"","parent":24,"count":59,"filter":"raw","term_order":"0","cat_ID":84,"category_count":59,"category_description":"","cat_name":"Templating &amp; Layout","category_nicename":"theming-overview","category_parent":24},{"term_id":97,"name":"Venues &amp; Organizers","slug":"venues-organizers","term_group":0,"term_taxonomy_id":97,"taxonomy":"category","description":"","parent":61,"count":8,"filter":"raw","term_order":"0","cat_ID":97,"category_count":8,"category_description":"","cat_name":"Venues &amp; Organizers","category_nicename":"venues-organizers","category_parent":61}],"tag_info":[{"term_id":20,"name":"Code","slug":"code","term_group":0,"term_taxonomy_id":20,"taxonomy":"post_tag","description":"","parent":0,"count":19,"filter":"raw","term_order":"0"},{"term_id":23,"name":"CSS","slug":"css","term_group":0,"term_taxonomy_id":23,"taxonomy":"post_tag","description":"","parent":20,"count":33,"filter":"raw","term_order":"0"},{"term_id":25,"name":"Customizations","slug":"customizations","term_group":0,"term_taxonomy_id":25,"taxonomy":"post_tag","description":"","parent":0,"count":102,"filter":"raw","term_order":"0"},{"term_id":58,"name":"PHP","slug":"php","term_group":0,"term_taxonomy_id":58,"taxonomy":"post_tag","description":"","parent":20,"count":78,"filter":"raw","term_order":"0"},{"term_id":96,"name":"Venues","slug":"venues","term_group":0,"term_taxonomy_id":96,"taxonomy":"post_tag","description":"","parent":0,"count":7,"filter":"raw","term_order":"0"}],"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1950969","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=1950969"}],"version-history":[{"count":2,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1950969\/revisions"}],"predecessor-version":[{"id":1968395,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1950969\/revisions\/1968395"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media\/1955565"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=1950969"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=1950969"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=1950969"},{"taxonomy":"stellar-product-taxonomy","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/stellar-product-taxonomy?post=1950969"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}