{"id":1944967,"date":"2020-01-27T08:12:05","date_gmt":"2020-01-27T13:12:05","guid":{"rendered":"https:\/\/theeventscalendar.com\/knowledgebase\/?post_type=tribe-knowledgebase&#038;p=1944967"},"modified":"2026-04-02T17:31:54","modified_gmt":"2026-04-02T21:31:54","slug":"display-custom-fields-in-the-month-view-tooltip","status":"publish","type":"post","link":"https:\/\/theeventscalendar.com\/knowledgebase\/display-custom-fields-in-the-month-view-tooltip\/","title":{"rendered":"Display Event Additional Fields in the Month View Tooltip"},"content":{"rendered":"\n<p>We have a feature in Events Calendar Pro called <a href=\"https:\/\/theeventscalendar.com\/knowledgebase\/k\/pro-additional-fields\/\" target=\"_blank\" rel=\"noreferrer noopener\">additional fields<\/a>, which allows customers to include fields into their Events to allow more information to be added to the Events.<\/p>\n\n\n\n<p>Our goal here is to create three custom fields using Events Calendar Pro, and make extra templates that display those fields after the event description in the tooltip for month view.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2020\/02\/month-view-tooltip.png\" alt=\"Month View tooltip\" class=\"wp-image-1945495\"\/><figcaption>Month view tooltip<\/figcaption><\/figure>\n\n\n\n<p>Following the same pattern we used in <a href=\"https:\/\/theeventscalendar.com\/knowledgebase\/k\/how-to-include-a-new-template-in-a-view\/\" target=\"_blank\" rel=\"noreferrer noopener\">&#8220;How to Include a New Template in a View&#8221;<\/a> you will create a new file in your child theme at this location:<code>[your-theme]\/tribe\/events\/v2\/month\/tooltip-extra-fields.php:<\/code>\u00a0<br><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;?php\n\/\/ Get the event ID.\n$event_id = get_the_ID();\n\n\/\/ Fetch from this Event all custom fields and their values.\n$fields = tribe_get_custom_fields( $event_id );\n?&gt;\n\n&lt;div class=&quot;theme-extra-event-fields&quot;&gt;\n&lt;?php if ( ! empty( $fields&#x5B;&#039;Artist&#039;] ) ) : ?&gt;\n  &lt;h4&gt;Artist&lt;\/h4&gt;\n  &lt;p&gt;\n    &lt;?php if ( ! empty( $fields&#x5B;&#039;Artist Instagram&#039;] ) ) : ?&gt;\n    &lt;a href=&quot;&lt;?php echo esc_url( $fields&#x5B;&#039;Artist Instagram&#039;] ); ?&gt;&quot; target=&quot;_blank&quot;&gt;\n      &lt;?php endif; ?&gt;\n      &lt;?php echo esc_html( $fields&#x5B;&#039;Artist&#039;] ); ?&gt;\n      &lt;?php if ( ! empty( $fields&#x5B;&#039;Artist Instagram&#039;] ) ) : ?&gt;\n    &lt;\/a&gt;\n    &lt;?php endif; ?&gt;\n  &lt;\/p&gt;\n&lt;?php endif; ?&gt;\n&lt;?php if ( ! empty( $fields&#x5B;&#039;VIP Confirmed&#039;] ) ) : ?&gt;\n  &lt;?php $vips = explode( &#039;,&#039;, $fields&#x5B;&#039;VIP Confirmed&#039;] ); ?&gt;\n  &lt;h4&gt;VIPs confirmed&lt;\/h4&gt;\n  &lt;ul&gt;\n  &lt;?php foreach ( $vips as $vip ) : ?&gt;\n    &lt;li&gt;&lt;?php echo esc_html( $vip ); ?&gt;&lt;\/li&gt;\n  &lt;?php endforeach; ?&gt;\n  &lt;\/ul&gt;\n&lt;?php endif; ?&gt;\n&lt;\/div&gt;\n<\/pre><\/div>\n\n\n<p>The template above will make the appropriate checks to display the Artist Name and, if an Instagram URL was included, make that into a link, as well as creating a list of the VIPs confirmed for the event.<\/p>\n\n\n\n<p>Now you will need to include this new template to show after the tooltip for the month view, using the following code in your functions.php file:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;?php \nadd_action( &#039;tribe_template_after_include:events\/v2\/month\/calendar-body\/day\/calendar-events\/calendar-event\/tooltip\/description&#039;,\n  function ( $file, $name, $template ) {\n    $template-&gt;template( &#039;month\/tooltip-extra-fields&#039; );\n  }, \n10, \n3 \n);\n<\/pre><\/div>\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>To style these newly added elements, 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<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: css; title: ; notranslate\" title=\"\">\n.tooltipster-base.tribe-events-tooltip-theme .theme-extra-event-fields {\n  font-size: 13px;\n}\n\n.tooltipster-base.tribe-events-tooltip-theme .theme-extra-event-fields h4 {\n  font-size: 15px;\n  margin-bottom: 10px;\n  margin-top: 10px;\n  font-weight: bold;\n}\n\n.tooltipster-base.tribe-events-tooltip-theme .theme-extra-event-fields a {\n  color: rgb(17, 85, 204);\n  font-weight: bold;\n}\n\n.tooltipster-base.tribe-events-tooltip-theme .theme-extra-event-fields ul {\n  list-style: disc;\n}\n\n.tooltipster-base.tribe-events-tooltip-theme .theme-extra-event-fields ul li {\n  margin-left: 16px;\n}\n<\/pre><\/div>\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 information on the tooltip.<\/p>\n\n\n\n<p>For this example, we made use of the additional fields from Events Calendar Pro, but you can modify the <code>[your-theme]\/tribe\/events\/v2\/month\/tooltip-extra-fields.php<\/code> template to include any kind of customization that you wish.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-related-filter\">Related filter<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/docs.theeventscalendar.com\/reference\/hooks\/tribe_template_pre_html\/\" target=\"_blank\" rel=\"noreferrer noopener\"><code>tribe_template_pre_html<\/code><\/a><\/li><li><a href=\"https:\/\/docs.theeventscalendar.com\/reference\/hooks\/tribe_template_pre_htmlhook_name\/\" target=\"_blank\" rel=\"noreferrer noopener\"><code>tribe_template_pre_html:$template<\/code><\/a><\/li><li><a href=\"https:\/\/docs.theeventscalendar.com\/reference\/hooks\/tribe_template_pre_html\/\" target=\"_blank\" rel=\"noreferrer noopener\"><code>tribe_template_html<\/code><\/a><\/li><li><a href=\"https:\/\/docs.theeventscalendar.com\/reference\/hooks\/tribe_template_pre_htmlhook_name\/\" target=\"_blank\" rel=\"noreferrer noopener\"><code>tribe_template_html:$template<\/code><\/a><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-related-actions\">Related actions<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/docs.theeventscalendar.com\/reference\/hooks\/tribe_template_before_include\/\" target=\"_blank\" rel=\"noreferrer noopener\"><code>tribe_template_before_include<\/code><\/a><\/li><li><a href=\"https:\/\/docs.theeventscalendar.com\/reference\/hooks\/tribe_template_before_includehookname\/\" target=\"_blank\" rel=\"noreferrer noopener\"><code>tribe_template_before_include:$template<\/code><\/a><\/li><li><a href=\"https:\/\/docs.theeventscalendar.com\/reference\/hooks\/tribe_template_after_include\/\" target=\"_blank\" rel=\"noreferrer noopener\"><code>tribe_template_after_include<\/code><\/a><\/li><li><a href=\"https:\/\/docs.theeventscalendar.com\/reference\/hooks\/tribe_template_after_includehookname\/\" target=\"_blank\" rel=\"noreferrer noopener\"><code>tribe_template_after_include:$template<\/code><\/a><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>We have a feature in Events Calendar Pro called additional fields, which allows customers to include fields into their Events to allow more information to be added to the Events. Our goal here is to create three custom fields using Events Calendar Pro, and make extra templates that display those fields after the event description&#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":[79],"tags":[20,23,58],"stellar-product-taxonomy":[158,161],"class_list":["post-1944967","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-snippets","tag-code","tag-css","tag-php","stellar-product-taxonomy-events-calendar-pro","stellar-product-taxonomy-the-events-calendar"],"acf":[],"taxonomy_info":{"category":[{"value":79,"label":"Snippets"}],"post_tag":[{"value":20,"label":"Code"},{"value":23,"label":"CSS"},{"value":58,"label":"PHP"}],"stellar-product-taxonomy":[{"value":158,"label":"Events Calendar Pro"},{"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":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}],"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":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"}],"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1944967","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=1944967"}],"version-history":[{"count":2,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1944967\/revisions"}],"predecessor-version":[{"id":1968450,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1944967\/revisions\/1968450"}],"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=1944967"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=1944967"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=1944967"},{"taxonomy":"stellar-product-taxonomy","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/stellar-product-taxonomy?post=1944967"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}