{"id":1961391,"date":"2024-07-15T03:43:23","date_gmt":"2024-07-15T07:43:23","guid":{"rendered":"https:\/\/theeventscalendar.com\/knowledgebase\/?p=1961391"},"modified":"2026-04-16T13:34:34","modified_gmt":"2026-04-16T17:34:34","slug":"customizing-list-view","status":"publish","type":"post","link":"https:\/\/theeventscalendar.com\/knowledgebase\/customizing-list-view\/","title":{"rendered":"Customizing The Events Calendar List View"},"content":{"rendered":"\n<p>List View is one of the most commonly used calendar displays in The Events Calendar. This article collects recipes for customizing what appears in List View. <\/p>\n\n\n\n<p>Unless otherwise noted, snippets can be added via your child theme&#8217;s <code>functions.php<\/code> file or using the <a href=\"https:\/\/wordpress.org\/plugins\/code-snippets\/\">Code Snippets plugin<\/a>. Template overrides should always be placed in a child theme. See <a href=\"https:\/\/theeventscalendar.com\/knowledgebase\/k\/best-practices-for-implementing-custom-code-snippets\/\">Best Practices for Implementing Custom Code Snippets<\/a> and <a href=\"https:\/\/theeventscalendar.com\/knowledgebase\/k\/customizing-template-files\/\">Customizing Template Files<\/a> for background on both approaches.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-showing-the-event-organizer\">Showing the Event Organizer<\/h2>\n\n\n\n<p>Out of the box, only the Venue name appears in List View. With a small customization, you can add the Organizer as well.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-method-1-action-hook\">Method 1: Action Hook<\/h4>\n\n\n\n<p>This snippet hooks into the venue template to output the organizer name immediately below it.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nadd_action( &#039;tribe_template_after_include:events\/v2\/list\/event\/venue&#039;, function ( $file, $name, $template ) {\n    $event = $template-&gt;get( &#039;event&#039; );\n\n    if ( empty( $event-&gt;ID ) ) {\n        return;\n    }\n\n    $organizer = tribe_get_organizer( $event-&gt;ID );\n\n    if ( ! empty( $organizer ) ) {\n        echo &#039;&amp;lt;div class=&quot;tribe-events-calendar-list__event-venue tribe-common-b2&quot;&gt;&#039;;\n        echo &#039;&amp;lt;span class=&quot;tribe-events-calendar-list__event-venue-title&quot;&gt;&amp;lt;strong&gt;&#039; . $organizer . &#039;&amp;lt;\/strong&gt;&amp;lt;\/span&gt;&#039;;\n        echo &#039;&amp;lt;\/div&gt;&#039;;\n    }\n}, 10, 3 );\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2026\/03\/venue-org.png\" alt=\"List View showing venue and organizer displayed together\"\/><\/figure>\n\n\n\n<p>For <a href=\"https:\/\/theeventscalendar.com\/product\/wordpress-events-calendar-pro\/\">Events Calendar Pro<\/a> users, you can extend this snippet so that organizer names link to their <a href=\"https:\/\/theeventscalendar.com\/knowledgebase\/venue-and-organizer-pages\/\">Organizer pages<\/a> (Pro only):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nadd_action( &#039;tribe_template_after_include:events\/v2\/list\/event\/venue&#039;, function ( $file, $name, $template ) {\n    $event = $template-&gt;get( &#039;event&#039; );\n\n    if ( empty( $event-&gt;ID ) ) {\n        return;\n    }\n\n    $organizer = tribe_get_organizer_link( $event-&gt;ID, true );\n\n    if ( ! empty( $organizer ) ) {\n        echo &#039;&amp;lt;style&gt;\n            .tribe-organizer-link a {\n                color: #0645ad !important;\n                text-decoration: underline !important;\n                font-weight: bold;\n            }\n        &amp;lt;\/style&gt;&#039;;\n\n        echo &#039;&amp;lt;div class=&quot;tribe-events-calendar-list__event-venue tribe-common-b2&quot;&gt;&#039;;\n        echo &#039;&amp;lt;span class=&quot;tribe-events-calendar-list__event-venue-title tribe-organizer-link&quot;&gt;&amp;lt;strong&gt;&#039; . $organizer . &#039;&amp;lt;\/strong&gt;&amp;lt;\/span&gt;&#039;;\n        echo &#039;&amp;lt;\/div&gt;&#039;;\n    }\n}, 10, 3 );\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2026\/03\/organizer-linked.png\" alt=\"List View showing organizer name as a clickable link\"\/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-method-2-template-override\">Method 2: Template Override<\/h4>\n\n\n\n<p>For a more advanced approach, create a <a href=\"https:\/\/theeventscalendar.com\/knowledgebase\/k\/customizing-template-files\/\">template override<\/a> for <code>tribe\/events\/v2\/list\/event.php<\/code>. The snippet below automates this: it creates the required folder structure in your active theme and writes a custom <code>event.php<\/code> file (runs only once), and also injects CSS into List View pages to style the organizer section.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;?php\n\/**\n * Auto-create template override for event organizers in list view\n * and add custom styling.\n *\/\n\nadd_action( &#039;init&#039;, &#039;create_event_organizers_template_override&#039; );\nfunction create_event_organizers_template_override() {\n    if ( get_option( &#039;event_organizers_template_created&#039; ) ) {\n        return;\n    }\n\n    $theme_dir    = get_stylesheet_directory();\n    $template_dir = $theme_dir . &#039;\/tribe\/events\/v2\/list&#039;;\n    $template_file = $template_dir . &#039;\/event.php&#039;;\n\n    if ( ! file_exists( $template_dir ) ) {\n        wp_mkdir_p( $template_dir );\n    }\n\n    if ( ! file_exists( $template_file ) ) {\n        $template_content = &#039;&amp;lt;?php\n$container_classes = &#x5B; \\&#039;tribe-common-g-row\\&#039;, \\&#039;tribe-events-calendar-list__event-row\\&#039; ];\n$container_classes&#x5B;\\&#039;tribe-events-calendar-list__event-row--featured\\&#039;] = $event-&gt;featured;\n$event_classes = tribe_get_post_class( &#x5B; \\&#039;tribe-events-calendar-list__event\\&#039;, \\&#039;tribe-common-g-row\\&#039;, \\&#039;tribe-common-g-row--gutters\\&#039; ], $event-&gt;ID );\n?&gt;\n&amp;lt;div &amp;lt;?php tribe_classes( $container_classes ); ?&gt;&gt;\n    &amp;lt;?php $this-&gt;template( \\&#039;list\/event\/date-tag\\&#039;, &#x5B; \\&#039;event\\&#039; =&gt; $event ] ); ?&gt;\n    &amp;lt;div class=&quot;tribe-events-calendar-list__event-wrapper tribe-common-g-col&quot;&gt;\n        &amp;lt;article &amp;lt;?php tribe_classes( $event_classes ) ?&gt;&gt;\n            &amp;lt;?php $this-&gt;template( \\&#039;list\/event\/featured-image\\&#039;, &#x5B; \\&#039;event\\&#039; =&gt; $event ] ); ?&gt;\n            &amp;lt;div class=&quot;tribe-events-calendar-list__event-details tribe-common-g-col&quot;&gt;\n                &amp;lt;header class=&quot;tribe-events-calendar-list__event-header&quot;&gt;\n                    &amp;lt;?php $this-&gt;template( \\&#039;list\/event\/date\\&#039;, &#x5B; \\&#039;event\\&#039; =&gt; $event ] ); ?&gt;\n                    &amp;lt;?php $this-&gt;template( \\&#039;list\/event\/title\\&#039;, &#x5B; \\&#039;event\\&#039; =&gt; $event ] ); ?&gt;\n                    &amp;lt;?php $this-&gt;template( \\&#039;list\/event\/venue\\&#039;, &#x5B; \\&#039;event\\&#039; =&gt; $event ] ); ?&gt;\n                &amp;lt;\/header&gt;\n                &amp;lt;?php $this-&gt;template( \\&#039;list\/event\/description\\&#039;, &#x5B; \\&#039;event\\&#039; =&gt; $event ] ); ?&gt;\n                &amp;lt;?php\n                $organizer_ids = tribe_get_organizer_ids( $event-&gt;ID );\n                if ( ! empty( $organizer_ids ) ) {\n                    $organizer_links = &#x5B;];\n                    foreach ( $organizer_ids as $organizer_id ) {\n                        if ( $organizer_id &gt; 0 ) {\n                            $organizer_name = get_the_title( $organizer_id );\n                            $organizer_url  = get_permalink( $organizer_id );\n                            if ( $organizer_name &amp;amp;&amp;amp; $organizer_url ) {\n                                $organizer_links&#x5B;] = \\&#039;&amp;lt;a href=&quot;\\&#039; . esc_url( $organizer_url ) . \\&#039;&quot; class=&quot;tribe-event-organizer-link&quot;&gt;\\&#039; . esc_html( $organizer_name ) . \\&#039;&amp;lt;\/a&gt;\\&#039;;\n                            }\n                        }\n                    }\n                    if ( ! empty( $organizer_links ) ) {\n                        echo \\&#039;&amp;lt;div class=&quot;tribe-events-calendar-list__event-organizers&quot;&gt;\\&#039;;\n                        echo \\&#039;&amp;lt;span class=&quot;tribe-event-organizers-label&quot;&gt;\\&#039; . esc_html__( \\&#039;Organized by:\\&#039;, \\&#039;the-events-calendar\\&#039; ) . \\&#039;&amp;lt;\/span&gt; \\&#039;;\n                        echo \\&#039;&amp;lt;span class=&quot;tribe-event-organizers&quot;&gt;\\&#039; . implode( \\&#039;, \\&#039;, $organizer_links ) . \\&#039;&amp;lt;\/span&gt;\\&#039;;\n                        echo \\&#039;&amp;lt;\/div&gt;\\&#039;;\n                    }\n                }\n                ?&gt;\n                &amp;lt;?php $this-&gt;template( \\&#039;list\/event\/cost\\&#039;, &#x5B; \\&#039;event\\&#039; =&gt; $event ] ); ?&gt;\n            &amp;lt;\/div&gt;\n        &amp;lt;\/article&gt;\n    &amp;lt;\/div&gt;\n&amp;lt;\/div&gt;&#039;;\n\n        file_put_contents( $template_file, $template_content );\n        update_option( &#039;event_organizers_template_created&#039;, true );\n    }\n}\n\nadd_action( &#039;wp_head&#039;, &#039;add_event_organizers_list_view_styles&#039; );\nfunction add_event_organizers_list_view_styles() {\n    if ( tribe_is_event_query() &amp;amp;&amp;amp; tribe_is_list_view() ) {\n        ?&gt;\n        &amp;lt;style&gt;\n            .tribe-events-calendar-list__event-organizers {\n                margin-top: 8px;\n                margin-bottom: 8px;\n                font-size: 0.85em;\n                color: #666;\n                line-height: 1.4;\n            }\n            .tribe-event-organizers-label {\n                font-weight: 600;\n                margin-right: 5px;\n                color: #333;\n            }\n            .tribe-event-organizer-link {\n                color: #0073aa;\n                text-decoration: none;\n                background: #f7f7f7;\n                padding: 2px 6px;\n                border-radius: 3px;\n                margin-right: 3px;\n                display: inline-block;\n                margin-bottom: 3px;\n            }\n            .tribe-event-organizer-link:hover {\n                color: #005a87;\n                background: #e7f3ff;\n            }\n            .tribe-event-organizers {\n                font-style: italic;\n            }\n        &amp;lt;\/style&gt;\n        &amp;lt;?php\n    }\n}\n?&gt;\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-showing-categories-and-tags\">Showing Categories and Tags<\/h2>\n\n\n\n<p>By default, List View does not display event categories or tags on each event card. Both can be added using the approaches below.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-showing-categories\">Showing Categories<\/h3>\n\n\n\n<p>There are two approaches. Use whichever fits your workflow best \u2014 both produce similar results.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-method-1-action-hook-simpler\">Method 1: Action Hook (simpler)<\/h4>\n\n\n\n<p>Paste this snippet into your child theme&#8217;s <code>functions.php<\/code> file. It injects a category list before the venue on each event card, then the CSS styles the categories as pill-shaped tags.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/\/ Inject the list of categories before the venue\nadd_action( &#039;tribe_template_before_include:events\/v2\/list\/event\/venue&#039;, function() {\n    global $post;\n    ?&gt;\n    &amp;lt;ul class=&#039;tribe-event-categories&#039;&gt;\n        &amp;lt;?php echo tribe_get_event_taxonomy( $post-&gt;ID ); ?&gt;\n    &amp;lt;\/ul&gt;\n    &amp;lt;?php\n} );\n<\/pre><\/div>\n\n\n<p>Add this CSS to <strong>Appearance \u2192 Customize \u2192 Additional CSS<\/strong> or your child theme&#8217;s stylesheet:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n.tribe-events-calendar-list__event-header {\n    display: flex !important;\n    flex-direction: column !important;\n}\n.tribe-events-calendar-list__event-title { order: 1; margin-bottom: 5px !important; }\n.tribe-events-calendar-list__event-datetime-wrapper { order: 2; margin-bottom: 10px !important; }\n.tribe-event-categories { order: 3; list-style: none; padding: 0; }\n\n.tribe-event-categories li {\n    display: inline-block !important;\n    background: #334aff;\n    padding: 4px 12px;\n    border-radius: 30px;\n    margin: 0 6px 5px 0;\n    font-size: 13px;\n}\n.tribe-event-categories li a {\n    color: #fff !important;\n    text-decoration: none !important;\n    font-weight: 600;\n}\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2021\/03\/Category-pills.png\" alt=\"List View showing category pills below event titles\"\/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-method-2-template-override-0\">Method 2: Template Override<\/h4>\n\n\n\n<p>Alternatively, use a template override of <code>event.php<\/code>. Copy the file from:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nwp-content\/plugins\/the-events-calendar\/src\/views\/v2\/list\/event.php\n<\/pre><\/div>\n\n\n<p>to:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;your-theme]\/tribe\/events\/v2\/list\/event.php\n<\/pre><\/div>\n\n\n<p>Then insert the following snippet at line 38, after the closing <code>&lt;\/header&gt;<\/code> tag:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;?php\necho tribe_get_event_categories(\n    $this-&gt;get( &#039;post_id&#039; ),\n    &#x5B;\n        &#039;before&#039;       =&gt; &#039;&#039;,\n        &#039;sep&#039;          =&gt; &#039;, &#039;,\n        &#039;after&#039;        =&gt; &#039;&#039;,\n        &#039;label&#039;        =&gt; null,\n        &#039;label_before&#039; =&gt; &#039;&amp;lt;span&gt;&#039;,\n        &#039;label_after&#039;  =&gt; &#039;&amp;lt;\/span&gt;&#039;,\n        &#039;wrap_before&#039;  =&gt; &#039;&amp;lt;p&gt;&#039;,\n        &#039;wrap_after&#039;   =&gt; &#039;&amp;lt;\/p&gt;&#039;,\n    ]\n);\n?&gt;\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2024\/06\/image-7.png\" alt=\"List View showing event categories below event details after template override\"\/><\/figure>\n\n\n\n<p>For more on event categories, see the <a href=\"https:\/\/theeventscalendar.com\/knowledgebase\/event-categories\/\">Event Categories knowledgebase article<\/a>. For template injection as an alternative, see <a href=\"https:\/\/theeventscalendar.com\/knowledgebase\/using-template-filters-and-actions\/\">Using Template Filters and Actions<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-showing-tags\">Showing Tags<\/h3>\n\n\n\n<p>If you use standard WordPress tags to categorize your events, you can display them as clickable links on each event card. The snippet below automates the process: it creates the necessary template override in your theme folder (once), adds the tag display code, and injects CSS only on List View pages.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/**\n * Auto-create template override for event tags in list view\n *\/\nadd_action( &#039;init&#039;, &#039;create_event_tags_template_override&#039; );\nfunction create_event_tags_template_override() {\n    if ( get_option( &#039;event_tags_template_created&#039; ) ) {\n        return;\n    }\n\n    $theme_dir     = get_stylesheet_directory();\n    $template_dir  = $theme_dir . &#039;\/tribe\/events\/v2\/list&#039;;\n    $template_file = $template_dir . &#039;\/event.php&#039;;\n\n    if ( ! file_exists( $template_dir ) ) {\n        wp_mkdir_p( $template_dir );\n    }\n\n    if ( ! file_exists( $template_file ) ) {\n        $template_content = &#039;&amp;lt;?php\n$container_classes = &#x5B; \\&#039;tribe-common-g-row\\&#039;, \\&#039;tribe-events-calendar-list__event-row\\&#039; ];\n$container_classes&#x5B;\\&#039;tribe-events-calendar-list__event-row--featured\\&#039;] = $event-&gt;featured;\n$event_classes = tribe_get_post_class( &#x5B; \\&#039;tribe-events-calendar-list__event\\&#039;, \\&#039;tribe-common-g-row\\&#039;, \\&#039;tribe-common-g-row--gutters\\&#039; ], $event-&gt;ID );\n?&gt;\n&amp;lt;div &amp;lt;?php tribe_classes( $container_classes ); ?&gt;&gt;\n    &amp;lt;?php $this-&gt;template( \\&#039;list\/event\/date-tag\\&#039;, &#x5B; \\&#039;event\\&#039; =&gt; $event ] ); ?&gt;\n    &amp;lt;div class=&quot;tribe-events-calendar-list__event-wrapper tribe-common-g-col&quot;&gt;\n        &amp;lt;article &amp;lt;?php tribe_classes( $event_classes ) ?&gt;&gt;\n            &amp;lt;?php $this-&gt;template( \\&#039;list\/event\/featured-image\\&#039;, &#x5B; \\&#039;event\\&#039; =&gt; $event ] ); ?&gt;\n            &amp;lt;div class=&quot;tribe-events-calendar-list__event-details tribe-common-g-col&quot;&gt;\n                &amp;lt;header class=&quot;tribe-events-calendar-list__event-header&quot;&gt;\n                    &amp;lt;?php $this-&gt;template( \\&#039;list\/event\/date\\&#039;, &#x5B; \\&#039;event\\&#039; =&gt; $event ] ); ?&gt;\n                    &amp;lt;?php $this-&gt;template( \\&#039;list\/event\/title\\&#039;, &#x5B; \\&#039;event\\&#039; =&gt; $event ] ); ?&gt;\n                    &amp;lt;?php $this-&gt;template( \\&#039;list\/event\/venue\\&#039;, &#x5B; \\&#039;event\\&#039; =&gt; $event ] ); ?&gt;\n                &amp;lt;\/header&gt;\n                &amp;lt;?php $this-&gt;template( \\&#039;list\/event\/description\\&#039;, &#x5B; \\&#039;event\\&#039; =&gt; $event ] ); ?&gt;\n                &amp;lt;?php $this-&gt;template( \\&#039;list\/event\/cost\\&#039;, &#x5B; \\&#039;event\\&#039; =&gt; $event ] ); ?&gt;\n                &amp;lt;?php\n                $tags = get_the_terms( $event-&gt;ID, \\&#039;post_tag\\&#039; );\n                if ( ! empty( $tags ) &amp;amp;&amp;amp; ! is_wp_error( $tags ) ) {\n                    $tags = array_values( array_filter( $tags, function( $term ) {\n                        return $term instanceof WP_Term;\n                    } ) );\n                    if ( ! empty( $tags ) ) {\n                        $tag_links = &#x5B;];\n                        foreach ( $tags as $tag ) {\n                            $link = tribe_events_get_url( &#x5B;\n                                \\&#039;tag\\&#039;          =&gt; $tag-&gt;slug,\n                                \\&#039;post_type\\&#039;    =&gt; \\&#039;tribe_events\\&#039;,\n                                \\&#039;eventDisplay\\&#039; =&gt; \\&#039;default\\&#039;\n                            ] );\n                            if ( ! is_wp_error( $link ) ) {\n                                $tag_links&#x5B;] = \\&#039;&amp;lt;a href=&quot;\\&#039; . esc_url( $link ) . \\&#039;&quot; rel=&quot;tag&quot; class=&quot;tribe-event-tag-link&quot;&gt;\\&#039; . esc_html( $tag-&gt;name ) . \\&#039;&amp;lt;\/a&gt;\\&#039;;\n                            }\n                        }\n                        if ( ! empty( $tag_links ) ) {\n                            echo \\&#039;&amp;lt;div class=&quot;tribe-events-calendar-list__event-tags&quot;&gt;\\&#039;;\n                            echo \\&#039;&amp;lt;span class=&quot;tribe-event-tags-label&quot;&gt;\\&#039; . esc_html__( \\&#039;Tags:\\&#039;, \\&#039;the-events-calendar\\&#039; ) . \\&#039;&amp;lt;\/span&gt; \\&#039;;\n                            echo \\&#039;&amp;lt;span class=&quot;tribe-event-tags&quot;&gt;\\&#039; . implode( \\&#039;, \\&#039;, $tag_links ) . \\&#039;&amp;lt;\/span&gt;\\&#039;;\n                            echo \\&#039;&amp;lt;\/div&gt;\\&#039;;\n                        }\n                    }\n                }\n                ?&gt;\n            &amp;lt;\/div&gt;\n        &amp;lt;\/article&gt;\n    &amp;lt;\/div&gt;\n&amp;lt;\/div&gt;\n&#039;;\n        file_put_contents( $template_file, $template_content );\n        update_option( &#039;event_tags_template_created&#039;, true );\n    }\n}\n\nadd_action( &#039;wp_head&#039;, &#039;add_event_tags_list_view_styles&#039; );\nfunction add_event_tags_list_view_styles() {\n    if ( tribe_is_event_query() &amp;amp;&amp;amp; tribe_is_list_view() ) {\n        ?&gt;\n        &amp;lt;style&gt;\n            .tribe-events-calendar-list__event-tags {\n                margin-top: 8px;\n                margin-bottom: 8px;\n                font-size: 0.85em;\n                color: #666;\n                line-height: 1.4;\n            }\n            .tribe-event-tags-label {\n                font-weight: 600;\n                margin-right: 5px;\n                color: #333;\n            }\n            .tribe-event-tag-link {\n                color: #0073aa;\n                text-decoration: none;\n                background: #f7f7f7;\n                padding: 2px 6px;\n                border-radius: 3px;\n                margin-right: 3px;\n                display: inline-block;\n                margin-bottom: 3px;\n            }\n            .tribe-event-tag-link:hover {\n                color: #005a87;\n                background: #e7f3ff;\n            }\n            .tribe-event-tags { font-style: italic; }\n        &amp;lt;\/style&gt;\n        &amp;lt;?php\n    }\n}\n?&gt;\n<\/pre><\/div>\n\n\n<p>\ud83d\udc4b <strong>Note:<\/strong> If you already have a <code>tribe\/events\/v2\/list\/event.php<\/code> template override in your theme from another customization (such as the organizer or categories sections above), this snippet will not overwrite it \u2014 it checks whether the file exists before creating it. In that case, manually add the tags block to your existing template file instead.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-display-the-event-author\">Display the Event Author<\/h2>\n\n\n\n<p>The List View shows upcoming events in a vertical list. To add the author&#8217;s name there, you can use a Template Override.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Copy the file <code>\/wp-content\/plugins\/the-events-calendar\/src\/views\/v2\/list\/event\/title.php<\/code> and paste it to <code>\/wp-content\/themes\/your-theme\/tribe\/events\/v2\/list\/event\/title.php<\/code><\/li>\n\n\n\n<li>Open the copied file and add this snippet right after the event title code which is after line 31:<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;?php\n$author_id = get_the_author_meta( &#039;ID&#039; );\n$author_name = get_the_author();\n$author_url = get_author_posts_url( $author_id );\n?&gt;\n\n&lt;p class=&quot;event-author&quot;&gt;\n    &lt;strong&gt;By:&lt;\/strong&gt; &lt;a href=&quot;&lt;?php echo esc_url( $author_url ); ?&gt;&quot;&gt;&lt;?php echo esc_html( $author_name ); ?&gt;&lt;\/a&gt;\n&lt;\/p&gt;\n\n<\/pre><\/div>\n\n\n<p>This will add the author&#8217;s name in list view as shown below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full has-custom-border\"><img loading=\"lazy\" decoding=\"async\" width=\"930\" height=\"345\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2025\/08\/Author-on-List.png\" alt=\"\" class=\"wp-image-1966434\" style=\"border-width:1px\" srcset=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2025\/08\/Author-on-List.png 930w, https:\/\/images.theeventscalendar.com\/kb\/uploads\/2025\/08\/Author-on-List-300x111.png 300w, https:\/\/images.theeventscalendar.com\/kb\/uploads\/2025\/08\/Author-on-List-768x285.png 768w\" sizes=\"auto, (max-width: 930px) 100vw, 930px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-showing-the-event-website-url\">Showing the Event Website URL<\/h2>\n\n\n\n<p>The event website URL is not shown in List View by default. To add it, use the following action hook. Note that the Block Editor supports both a website URL and a custom label, while the Classic Editor only supports the URL \u2014 the snippet below handles both cases by reading the label from the Block Editor markup when available, and falling back to &#8220;Website URL&#8221; otherwise.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;?php\nadd_action(\n    &#039;tribe_template_after_include:events\/v2\/list\/event\/description&#039;,\n    function ( $file, $name, $template ) {\n        global $post;\n        $content = $post-&gt;post_content;\n\n        preg_match( &#039;\/&amp;lt;!-- wp:tribe\\\/event-website {&quot;urlLabel&quot;:&quot;(.*?)&quot;} \\\/--&gt;\/&#039;, $content, $matches );\n\n        $urlLabel = ( isset( $matches&#x5B;1] ) ) ? $matches&#x5B;1] : &#039;Website URL&#039;;\n\n        echo tribe_get_event_website_link( $post-&gt;ID, $urlLabel, &#039;_blank&#039; );\n    },\n    10,\n    3\n);\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2024\/07\/List-Block.jpg\" alt=\"List View showing the event website URL link below the description\"\/><\/figure>\n\n\n\n<p>In the Block Editor, the website label and URL look like this when editing an event:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2024\/06\/image-5.png\" alt=\"Block Editor showing the event website label and URL fields\"\/><\/figure>\n\n\n\n<p>In the Classic Editor, only the URL field is available:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2024\/07\/List-Classic-1024x254.png\" alt=\"Classic Editor showing only the event website URL field without a label option\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-adding-a-read-more-link\">Adding a &#8220;Read More&#8221; Link<\/h2>\n\n\n\n<p>By default, List View does not include a &#8220;Read More&#8221; or &#8220;View Event&#8221; link separate from the event title. The following snippet adds one after the event description.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nadd_action(\n    &#039;tribe_template_after_include:events\/v2\/list\/event\/description&#039;,\n    function ( $file, $name, $template ) {\n        echo &#039;&amp;lt;a class=&quot;list-view-read-more&quot; href=&quot;&#039; . tribe_get_event_link() . &#039;&quot;&gt;View Event&amp;lt;\/a&gt;&#039;;\n    },\n    10,\n    3\n);\n<\/pre><\/div>\n\n\n<p>To style the link, add the following CSS to <strong>Appearance \u2192 Customize \u2192 Additional CSS<\/strong> or your child theme&#8217;s stylesheet and adjust as needed:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n.list-view-read-more {\n    background-color: #000;\n    color: #fff;\n    padding: 10px 15px;\n    border-radius: 3px;\n    text-decoration: none;\n}\n\n.list-view-read-more:hover {\n    background-color: #fff;\n    color: #000;\n}\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-customizing-the-event-description\">Customizing the Event Description<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-hiding-the-description\">Hiding the Description<\/h3>\n\n\n\n<p>To hide the event description entirely in List View, add the following CSS to <strong>Appearance \u2192 Customize \u2192 Additional CSS<\/strong> or your child theme&#8217;s stylesheet. If you are using a caching plugin, clear your cache after saving.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n.tribe-events-calendar-list__event-details .tribe-events-calendar-list__event-description p {\n    display: none;\n}\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2024\/07\/Desc_ListView-withDesc-1-1024x614.jpg\" alt=\"List View with event description visible (default)\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2024\/07\/Desc_ListView-1024x614.jpg\" alt=\"List View with event description hidden using CSS\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-controlling-the-excerpt-length\">Controlling the Excerpt Length<\/h3>\n\n\n\n<p>By default, TEC uses the event&#8217;s excerpt field when rendering the description in List View. There are two ways to control the length.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-method-1-template-override\">Method 1: Template Override<\/h4>\n\n\n\n<p>For precise control over word count and HTML stripping, override the description template. Copy the file from:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nwp-content\/plugins\/the-events-calendar\/src\/views\/v2\/list\/event\/description.php\n<\/pre><\/div>\n\n\n<p>to:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;your-child-theme]\/tribe\/events\/v2\/list\/event\/description.php\n<\/pre><\/div>\n\n\n<p>Open the copied file and replace the line:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;?php echo (string) $event-&gt;excerpt; ?&gt;\n<\/pre><\/div>\n\n\n<p>with:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;?php\n    \/\/ Get the full content of the event post\n    $full = get_the_content( null, false, get_the_ID() );\n\n    \/\/ Strip all HTML tags to prevent markup issues\n    $plain = wp_strip_all_tags( $full );\n\n    \/\/ Trim to 20 words, appending &quot;...&quot; if longer\n    echo wp_trim_words( $plain, 20, &#039;...&#039; );\n?&gt;\n<\/pre><\/div>\n\n\n<p>Change <code>20<\/code> to your preferred word count. Event descriptions longer than that number will be truncated; shorter ones will display in full.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-method-2-the-excerpt-length-filter\">Method 2: The excerpt_length Filter<\/h4>\n\n\n\n<p>For a simpler code-only approach that applies globally (not just List View), add this to your <code>functions.php<\/code> file:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nadd_filter( &#039;excerpt_length&#039;, function ( $length ) {\n    return 20; \/\/ Change 20 to the number of words you want to display.\n}, 99 );\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-displaying-additional-fields-next-to-the-title\">Displaying Additional Fields Next to the Title<\/h2>\n\n\n\n<p>With <a href=\"https:\/\/theeventscalendar.com\/product\/wordpress-events-calendar-pro\/\">Events Calendar Pro<\/a>, you can add custom Additional Fields to events and display their values alongside the event title in List View using a template override of the title template.<\/p>\n\n\n\n<p>Copy the file from:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nwp-content\/plugins\/the-events-calendar\/src\/views\/v2\/list\/event\/title.php\n<\/pre><\/div>\n\n\n<p>to:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;your-child-theme]\/tribe\/events\/v2\/list\/event\/title.php\n<\/pre><\/div>\n\n\n<p>Replace the contents with the following, adjusting <code>'Artists'<\/code> to match your Additional Field name:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;h3 class=&quot;tribe-events-calendar-list__event-title tribe-common-h6 tribe-common-h4--min-medium&quot;&gt;\n    &amp;lt;a\n        href=&quot;&amp;lt;?php echo esc_url( $event-&gt;permalink ); ?&gt;&quot;\n        title=&quot;&amp;lt;?php echo esc_attr( $event-&gt;title ); ?&gt;&quot;\n        rel=&quot;bookmark&quot;\n        class=&quot;tribe-events-calendar-list__event-title-link tribe-common-anchor-thin&quot;\n    &gt;\n        &amp;lt;?php\n        \/\/ phpcs:ignore\n        echo $event-&gt;title;\n\n        \/\/ Fetch all custom fields and their values for this event.\n        $fields = tribe_get_custom_fields( $event-&gt;ID );\n\n        \/\/ If there is an &quot;Artists&quot; field, print its value.\n        if ( ! empty( $fields&#x5B;&#039;Artists&#039;] ) ) :\n            echo &#039; &#039; . esc_html( $fields&#x5B;&#039;Artists&#039;] );\n        endif;\n        ?&gt;\n    &amp;lt;\/a&gt;\n&amp;lt;\/h3&gt;\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2024\/01\/Screen-Shot-2024-01-11-at-4.53.00-PM.png\" alt=\"Block Editor showing an Additional Field named 'Artist' on an event\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2024\/01\/Screen-Shot-2024-01-11-at-4.54.47-PM.png\" alt=\"List View showing the Artist field value displayed next to the event title\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-using-custom-featured-image-sizes\">Using Custom Featured Image Sizes<\/h2>\n\n\n\n<p>The default List View template uses the plugin&#8217;s internal <code>$event-&gt;thumbnail<\/code> object to render featured images, which does not recognize custom image sizes registered in your theme via <code>add_image_size()<\/code>. To use a custom size, you need to override the featured image template and switch to <code>get_the_post_thumbnail()<\/code>.<\/p>\n\n\n\n<p>Copy the file from:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nwp-content\/plugins\/the-events-calendar\/src\/views\/v2\/list\/event\/featured-image.php\n<\/pre><\/div>\n\n\n<p>to:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;your-child-theme]\/tribe\/events\/v2\/list\/event\/featured-image.php\n<\/pre><\/div>\n\n\n<p>Replace the contents with:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;?php\n\/**\n * Template override to use custom theme image sizes.\n *\/\nif ( ! has_post_thumbnail( $event-&gt;ID ) ) {\n    return;\n}\n?&gt;\n\n&amp;lt;div class=&quot;tribe-events-calendar-list__event-featured-image-wrapper tribe-common-g-col&quot;&gt;\n    &amp;lt;?php\n    echo get_the_post_thumbnail(\n        $event-&gt;ID,\n        &#039;your-custom-size-name&#039;, \/\/ Replace with your theme&#039;s image size slug\n        &#x5B;\n            &#039;class&#039;   =&gt; &#039;tribe-events-calendar-list__event-featured-image&#039;,\n            &#039;loading&#039; =&gt; &#039;lazy&#039;,\n        ]\n    );\n    ?&gt;\n&amp;lt;\/div&gt;\n<\/pre><\/div>\n\n\n<p>Replace <code>'your-custom-size-name'<\/code> with the slug you registered in your theme&#8217;s <code>functions.php<\/code>, for example <code>add_image_size( 'event-list-thumb', 480, 320, true )<\/code>.<\/p>\n\n\n\n<p><strong>After saving:<\/strong> If you recently added the new image size, existing images won&#8217;t have it yet \u2014 use a plugin like <a href=\"https:\/\/wordpress.org\/plugins\/regenerate-thumbnails\/\">Regenerate Thumbnails<\/a> to generate the new sizes for existing uploads. Then clear any site or server caching.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-making-the-featured-image-link-to-the-event\">Making the Featured Image Link to the Event<\/h2>\n\n\n\n<p>In recent versions of TEC, featured images in List View are intentionally not linked to the single event page. This was an accessibility improvement to avoid redundant links (since the event title already links to the page). If you prefer the image to be clickable, the following filter wraps it in a link.<\/p>\n\n\n\n<p>This can be added to your child theme&#8217;s <code>functions.php<\/code> or via Code Snippets. You can also create a template override \u2014 see below for both approaches.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-option-a-filter-no-template-file-needed\">Option A: Filter (no template file needed)<\/h4>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nadd_filter(\n    &#039;tribe_template_html:events\/v2\/list\/event\/featured-image&#039;,\n    function ( $html, $file, $name, $template ) {\n        $event = $template-&gt;get( &#039;event&#039; );\n\n        $anchor_open = sprintf(\n            &#039;&amp;lt;a href=&quot;%s&quot; title=&quot;%s&quot; rel=&quot;bookmark&quot; class=&quot;tribe-events-calendar-list__event-featured-image-link&quot; tabindex=&quot;-1&quot; aria-hidden=&quot;true&quot;&gt;&#039;,\n            esc_url( $event-&gt;permalink ),\n            esc_attr( $event-&gt;title )\n        );\n\n        $html = preg_replace( &#039;\/(&amp;lt;img&#x5B;^&gt;]*&gt;)\/&#039;, $anchor_open . &#039;$1&amp;lt;\/a&gt;&#039;, $html );\n\n        return $html;\n    },\n    10,\n    4\n);\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"h-option-b-template-override\">Option B: Template Override<\/h4>\n\n\n\n<p>Create the folder structure in your child theme:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;your-child-theme]\/tribe\/events\/v2\/list\/event\/featured-image.php\n<\/pre><\/div>\n\n\n<p>Add the following contents:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;?php\n\/**\n * View: List View - Event Featured Image (linked to single event)\n *\/\nif ( ! $event-&gt;thumbnail-&gt;exists ) {\n    return;\n}\n?&gt;\n&amp;lt;div class=&quot;tribe-events-calendar-list__event-featured-image-wrapper&quot;&gt;\n    &amp;lt;a\n        href=&quot;&amp;lt;?php echo esc_url( $event-&gt;permalink ); ?&gt;&quot;\n        title=&quot;&amp;lt;?php echo esc_attr( $event-&gt;title ); ?&gt;&quot;\n        class=&quot;tribe-events-calendar-list__event-featured-image-link&quot;\n    &gt;\n        &amp;lt;img\n            src=&quot;&amp;lt;?php echo esc_url( $event-&gt;thumbnail-&gt;full-&gt;url ); ?&gt;&quot;\n            &amp;lt;?php if ( ! empty( $event-&gt;thumbnail-&gt;srcset ) ) : ?&gt;\n                srcset=&quot;&amp;lt;?php echo esc_attr( $event-&gt;thumbnail-&gt;srcset ); ?&gt;&quot;\n            &amp;lt;?php endif; ?&gt;\n            &amp;lt;?php if ( ! empty( $event-&gt;thumbnail-&gt;alt ) ) : ?&gt;\n                alt=&quot;&amp;lt;?php echo esc_attr( $event-&gt;thumbnail-&gt;alt ); ?&gt;&quot;\n            &amp;lt;?php else : ?&gt;\n                alt=&quot;&quot;\n            &amp;lt;?php endif; ?&gt;\n            class=&quot;tribe-events-calendar-list__event-featured-image&quot;\n        \/&gt;\n    &amp;lt;\/a&gt;\n&amp;lt;\/div&gt;\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-full-width-layout-when-no-featured-image-is-present\">Full-Width Layout When No Featured Image Is Present<\/h2>\n\n\n\n<p>By default, the List View layout reserves space for a featured image on the left of each event card. When an event has no image, this can leave the event content looking narrow. The following snippet detects events without a featured image after the page loads and expands the content area to full width for those events.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nadd_action( &#039;wp_footer&#039;, function() {\n    ?&gt;\n    &amp;lt;script&gt;\n    jQuery(document).ready(function($) {\n        \/\/ Find every event in the List View\n        $(&#039;.tribe-events-calendar-list__event&#039;).each(function() {\n            \/\/ Check if the featured image wrapper is NOT present\n            if ( $(this).find(&#039;.tribe-events-calendar-list__event-featured-image-wrapper&#039;).length === 0 ) {\n                \/\/ If no image, set the event details to 100% width\n                $(this).find(&#039;.tribe-events-calendar-list__event-details&#039;).css(&#039;width&#039;, &#039;100%&#039;);\n            }\n        });\n    });\n    &amp;lt;\/script&gt;\n    &amp;lt;?php\n} );\n<\/pre><\/div>\n\n\n<p>After adding the snippet, clear any site cache to ensure the script loads on the front end.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-link-featured-image-to-event-page\">Link Featured Image to Event Page<\/h2>\n\n\n\n<p><strong>Accessibility Note: <\/strong>When both the event image and the title link to the same page, it creates what&#8217;s known as redundant links, which can confuse assistive technologies. According to accessibility standards like WCAG 2.1 (specifically criteria 2.4.4 and 1.1.1), redundant or ambiguous links can make it harder for users with visual or cognitive impairments to understand and navigate your content effectively.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">add_filter( 'tribe_template_html:events\/v2\/list\/event\/featured-image', function ( $html, $file, $name, $template ) {\n\t$event = $template-&gt;get( 'event' );\n\n\t\/\/ Build anchor output\n\t$anchor_open = sprintf(\n\t\t'&lt;a href=\"%s\" title=\"%s\" rel=\"bookmark\" class=\"tribe-events-calendar-list__event-featured-image-link\" tabindex=\"-1\" aria-hidden=\"true\"&gt;',\n\t\tesc_url( $event-&gt;permalink ),\n\t\tesc_attr( $event-&gt;title )\n\t);\n\n\t\/\/ Wrap img with anchor\n\t$html = preg_replace(\n\t\t'\/(&lt;img[^&gt;]*&gt;)\/',\n\t\t$anchor_open . '$1&lt;\/a&gt;',\n\t\t$html\n\t);\n\n\treturn $html;\n}, 10, 4 );<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-advanced-adding-a-notice-toggle-above-the-calendar\">Advanced: Adding a Notice Toggle Above the Calendar<\/h2>\n\n\n\n<p>The Events Calendar includes a built-in accordion JavaScript utility that you can hook into for your own customizations. The following example uses it to add a toggleable notice above the List View&#8217;s search\/filter bar. This customization involves a template override of the top-level <code>list.php<\/code>, a new <code>notice.php<\/code> partial, CSS, and a JavaScript file.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2020\/02\/KB-list-view.png\" alt=\"The area above the events bar where the notice toggle will be added\"\/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-step-1-override-the-list-view-template\">Step 1: Override the List View Template<\/h4>\n\n\n\n<p>Copy the file from:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/wp-content\/plugins\/the-events-calendar\/src\/views\/v2\/list.php\n<\/pre><\/div>\n\n\n<p>to:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;your-child-theme]\/tribe\/events\/v2\/list.php\n<\/pre><\/div>\n\n\n<p>Edit the copied file to add <code>$this-&gt;template( 'list\/notice' );<\/code> inside the main container, just before the <code>&lt;header&gt;<\/code>. The relevant section should look like this:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;div class=&quot;tribe-common-l-container tribe-events-l-container&quot;&gt;\n    &amp;lt;?php $this-&gt;template( &#039;components\/loader&#039;, &#x5B; &#039;text&#039; =&gt; __( &#039;Loading...&#039;, &#039;the-events-calendar&#039; ) ] ); ?&gt;\n    &amp;lt;?php $this-&gt;template( &#039;components\/data&#039; ); ?&gt;\n    &amp;lt;?php $this-&gt;template( &#039;components\/before&#039; ); ?&gt;\n    &amp;lt;?php $this-&gt;template( &#039;list\/notice&#039; ); ?&gt;\n\n    &amp;lt;header &amp;lt;?php tribe_classes( $header_classes ); ?&gt;&gt;\n        &amp;lt;?php $this-&gt;template( &#039;components\/messages&#039; ); ?&gt;\n        &amp;lt;?php $this-&gt;template( &#039;components\/breadcrumbs&#039; ); ?&gt;\n        &amp;lt;?php $this-&gt;template( &#039;components\/events-bar&#039; ); ?&gt;\n        &amp;lt;?php $this-&gt;template( &#039;list\/top-bar&#039; ); ?&gt;\n    &amp;lt;\/header&gt;\n    ...\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"h-step-2-create-the-notice-template\">Step 2: Create the Notice Template<\/h4>\n\n\n\n<p>Create a new file at:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;your-child-theme]\/tribe\/events\/v2\/list\/notice.php\n<\/pre><\/div>\n\n\n<p>Add the following HTML. The <code>data-js<\/code> attributes connect the elements to the JavaScript accordion, and the <code>aria<\/code> attributes improve accessibility.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;div class=&quot;tribe-events-list-notice__wrapper&quot; data-js=&quot;tribe-events-list-notice-wrapper&quot;&gt;\n    &amp;lt;button\n        class=&quot;tribe-events-list-notice__trigger tribe-common-c-btn-border&quot;\n        data-js=&quot;tribe-events-list-notice-trigger&quot;\n        aria-controls=&quot;tribe-events-list-notice&quot;\n        aria-expanded=&quot;true&quot;\n    &gt;\n        &amp;lt;?php esc_html_e( &#039;Hide notice&#039;, &#039;your-text-domain&#039; ); ?&gt;\n    &amp;lt;\/button&gt;\n    &amp;lt;div\n        class=&quot;tribe-events-list-notice__notice tribe-events-list-notice__notice--show&quot;\n        id=&quot;tribe-events-list-notice&quot;\n        aria-hidden=&quot;false&quot;\n    &gt;\n        &amp;lt;p class=&quot;tribe-events-list-notice__notice-text tribe-common-b1&quot;&gt;\n            &amp;lt;?php esc_html_e( &#039;This is the fantastic notice!&#039;, &#039;your-text-domain&#039; ); ?&gt;\n        &amp;lt;\/p&gt;\n    &amp;lt;\/div&gt;\n&amp;lt;\/div&gt;\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2020\/02\/KB-list-view-with-notice.png\" alt=\"The notice toggle now appearing above the events bar in List View\"\/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-step-3-add-the-css\">Step 3: Add the CSS<\/h4>\n\n\n\n<p>Add the following to your child theme&#8217;s stylesheet or <strong>Appearance \u2192 Customize \u2192 Additional CSS<\/strong>:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n.tribe-events .tribe-events-list-notice__wrapper {\n    padding-bottom: 30px;\n}\n\n.tribe-common--breakpoint-medium.tribe-events .tribe-events-list-notice__wrapper {\n    padding-bottom: 45px;\n}\n\n.tribe-events .tribe-events-list-notice__notice {\n    display: none;\n    padding-top: 15px;\n}\n\n.tribe-events .tribe-events-list-notice__notice--show {\n    display: block;\n}\n\n.tribe-common--breakpoint-medium.tribe-events .tribe-events-list-notice__notice {\n    padding-top: 20px;\n}\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-step-4-create-the-javascript-file\">Step 4: Create the JavaScript File<\/h3>\n\n\n\n<p>Create the file at <code>[your-child-theme]\/assets\/js\/list-notice.js<\/code> (adjust the path if you prefer a different location):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nvar listNotice = {};\n\n( function( $, obj, manager, accordion ) {\n    &#039;use strict&#039;;\n    var $document = $( document );\n\n    obj.selectors = {\n        listNoticeWrapper: &#039;&#x5B;data-js=&quot;tribe-events-list-notice-wrapper&quot;]&#039;,\n        listNoticeTrigger: &#039;&#x5B;data-js=&quot;tribe-events-list-notice-trigger&quot;]&#039;,\n        listNoticeShowClass: &#039;.tribe-events-list-notice__notice--show&#039;,\n    };\n\n    obj.handleClick = function( event ) {\n        var $trigger = event.data.trigger;\n        var open = $trigger.attr( &#039;aria-expanded&#039; ) === &#039;true&#039;;\n\n        var text = open ? &#039;Hide notice&#039; : &#039;Show notice&#039;;\n        $trigger.text( text );\n\n        var $wrapper = $trigger.closest( obj.selectors.listNoticeWrapper );\n        var $notice = $wrapper.find( &#039;#&#039; + $trigger.attr( &#039;aria-controls&#039; ) );\n        open\n            ? $notice.addClass( obj.selectors.listNoticeShowClass.className() )\n            : $notice.removeClass( obj.selectors.listNoticeShowClass.className() );\n    };\n\n    obj.deinitTrigger = function( $container ) {\n        var $trigger = $container.find( obj.selectors.listNoticeTrigger );\n        accordion.deinitAccordion( 0, $trigger );\n    };\n\n    obj.initTrigger = function( $container, $trigger ) {\n        accordion.initAccordion( $container )( 0, $trigger );\n    };\n\n    obj.bindEvents = function( $trigger ) {\n        $trigger.on( &#039;click&#039;, { trigger: $trigger }, obj.handleClick );\n    };\n\n    obj.deinit = function( event, jqXHR, settings ) {\n        var $container = event.data.container;\n        obj.deinitTrigger( $container );\n        $container.off( &#039;beforeAjaxSuccess.tribeEvents&#039;, obj.deinit );\n    };\n\n    obj.init = function( event, index, $container, data ) {\n        var $trigger = $container.find( obj.selectors.listNoticeTrigger );\n\n        if ( ! $trigger.length ) {\n            return;\n        }\n\n        obj.initTrigger( $container, $trigger );\n        obj.bindEvents( $trigger );\n        $container.on( &#039;beforeAjaxSuccess.tribeEvents&#039;, { container: $container }, obj.deinit );\n    };\n\n    obj.ready = function( event ) {\n        manager = tribe.events.views.manager;\n        manager.$containers.each( function( index, container ) {\n            var $container = $( container );\n            obj.init( event, index, $container, manager.getContainerData( $container ) );\n        } );\n        $document.on( &#039;afterSetup.tribeEvents&#039;, manager.selectors.container, obj.init );\n    };\n\n    $document.ready( obj.ready );\n} )( jQuery, listNotice, tribe.events.views.manager, tribe.events.views.accordion );\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"h-step-5-enqueue-the-javascript-file\">Step 5: Enqueue the JavaScript File<\/h4>\n\n\n\n<p>Add the following to your child theme&#8217;s <code>functions.php<\/code> to load the script, which depends on TEC&#8217;s built-in accordion utility:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nfunction add_list_notice_js() {\n    wp_enqueue_script(\n        &#039;custom-list-notice-js&#039;,\n        get_stylesheet_directory_uri() . &#039;\/assets\/js\/list-notice.js&#039;,\n        &#x5B; &#039;tribe-events-views-v2-accordion&#039; ],\n        false,\n        true\n    );\n}\nadd_action( &#039;wp_enqueue_scripts&#039;, &#039;add_list_notice_js&#039; );\n<\/pre><\/div>\n\n\n<p>Visit your List View page and you should see the working notice toggle.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/theeventscalendar.com\/knowledgebase\/wp-content\/uploads\/2020\/02\/KB-list-view-notice-accordion.gif\" alt=\"Animated demo of the notice toggle showing and hiding in List View\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>List View is one of the most commonly used calendar displays in The Events Calendar. This article collects recipes for customizing what appears in List View. Unless otherwise noted, snippets can be added via your child theme&#8217;s functions.php file or using the Code Snippets plugin. Template overrides should always be placed in a child theme&#8230;.<\/p>\n","protected":false},"author":27,"featured_media":1955565,"comment_status":"open","ping_status":"open","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":[312,24,79],"tags":[],"stellar-product-taxonomy":[161],"class_list":["post-1961391","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-calendar-views","category-customizing","category-snippets","stellar-product-taxonomy-the-events-calendar"],"acf":[],"taxonomy_info":{"category":[{"value":312,"label":"Calendar Views"},{"value":24,"label":"Customizations"},{"value":79,"label":"Snippets"}],"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":"Abz","author_link":"https:\/\/theeventscalendar.com\/knowledgebase\/author\/abz\/"},"comment_info":0,"category_info":[{"term_id":312,"name":"Calendar Views","slug":"calendar-views","term_group":0,"term_taxonomy_id":312,"taxonomy":"category","description":"","parent":61,"count":5,"filter":"raw","term_order":"0","cat_ID":312,"category_count":5,"category_description":"","cat_name":"Calendar Views","category_nicename":"calendar-views","category_parent":61},{"term_id":24,"name":"Customizations","slug":"customizing","term_group":0,"term_taxonomy_id":24,"taxonomy":"category","description":"","parent":0,"count":76,"filter":"raw","term_order":"0","cat_ID":24,"category_count":76,"category_description":"","cat_name":"Customizations","category_nicename":"customizing","category_parent":0},{"term_id":79,"name":"Snippets","slug":"snippets","term_group":0,"term_taxonomy_id":79,"taxonomy":"category","description":"","parent":0,"count":44,"filter":"raw","term_order":"0","cat_ID":79,"category_count":44,"category_description":"","cat_name":"Snippets","category_nicename":"snippets","category_parent":0}],"tag_info":false,"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1961391","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\/27"}],"replies":[{"embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=1961391"}],"version-history":[{"count":13,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1961391\/revisions"}],"predecessor-version":[{"id":1969230,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1961391\/revisions\/1969230"}],"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=1961391"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=1961391"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=1961391"},{"taxonomy":"stellar-product-taxonomy","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/stellar-product-taxonomy?post=1961391"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}