{"id":1957571,"date":"2022-09-06T03:38:19","date_gmt":"2022-09-06T07:38:19","guid":{"rendered":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/?post_type=post&#038;p=1952778"},"modified":"2024-10-25T11:01:34","modified_gmt":"2024-10-25T15:01:34","slug":"changing-the-series-view","status":"publish","type":"post","link":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/changing-the-series-view\/","title":{"rendered":"Changing the Series View"},"content":{"rendered":"\n<p>By default, the Series page displays events in Summary View on the frontend. If you&#8217;d prefer to use a different view, you can do so with a filter. Keep in mind that this filter will change the default view for all Series on your site. <\/p>\n\n\n\n<p>We&#8217;ll provide you with the snippet here, so let&#8217;s take a look!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-the-snippet\">The snippet<\/h2>\n\n\n\n<p>To change the default Series view to List, add the following snippet to your theme&#8217;s functions.php file or use the <a href=\"https:\/\/wordpress.org\/plugins\/code-snippets\" target=\"_blank\" rel=\"noreferrer noopener\">Code Snippets<\/a> plugin . You can adjust the snippet to use a different view by replacing <code><em>list<\/em><\/code><em> <\/em>with a different view name.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nadd_filter(\n\t&#039;tec_events_pro_custom_tables_v1_series_event_view_slug&#039;,\n\tfunction ( $view ) {\n\t\treturn &#039;list&#039;;\n\t}\n);\n<\/pre><\/div>\n\n\n<p>If you&#8217;d like to use a different template for the Event Series Single, you can use this snippet, making sure to point the call to <code>locate_template()<\/code> to the template you want to use (<em>\/wp-content\/themes\/your-active-theme\/<\/em> folder).<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n\/* 1 - Define another template *\/\nadd_filter(\n\t&#039;template_include&#039;,\n\tstatic function ( $template ) {\n\t\tif ( is_singular( &#039;tribe_event_series&#039; ) ) {\n\t\t\t\/\/ Point this to the template you want to use.\n\t\t\t$template = locate_template( &#039;templates\/some-template.php&#039; );\n\t\t}\n\n\t\treturn $template;\n\t}\n);\n\n\/* 2 - Remove the Series Calendar view from being injected into your custom template *\/\n\nuse TEC\\Events_Pro\\Custom_Tables\\V1\\Templates\\Series_Filters;\n\nadd_filter(\n\t&#039;template_include&#039;,\n\tstatic function ( $template ) {\n\t\tif ( ! has_action( &#039;tribe_common_loaded&#039;, &#039;tribe_register_pro&#039; ) ) {\n\t\t\treturn $template;\n\t\t}\n\n\t\tremove_filter( &#039;the_content&#039;, &#x5B; tribe( Series_Filters::class ), &#039;inject_content&#039; ], 10 );\n\n\t\treturn $template;\n\t},\n\t15\n);\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">Opting Out of Series Content Injection<\/h3>\n\n\n\n<p>By default, the Series page displays a list of events related to the series. If you&#8217;d prefer to opt out and prevent this list from being displayed, you can use the follwoing filter that allows you to disable the automatic injection of the series content into <code>the_content<\/code>.<\/p>\n\n\n\n<p>Returning <code>false<\/code>, the series list will no longer be shown on the series page.<\/p>\n\n\n\n<p>Here\u2019s the snippet:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nadd_filter( &#039;tec_events_pro_enable_series_content_injection&#039;, &#039;__return_false&#039; );\n<\/pre><\/div>\n\n\n<p>Just like the other snippets, you can add this to your theme\u2019s <code>functions.php<\/code> file or use a plugin like Code Snippets.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By default, the Series page displays events in Summary View on the frontend. If you&#8217;d prefer to use a different view, you can do so with a filter. Keep in mind that this filter will change the default view for all Series on your site. We&#8217;ll provide you with the snippet here, so let&#8217;s take&#8230;<\/p>\n","protected":false},"author":7,"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":[1],"tags":[],"stellar-product-taxonomy":[158],"class_list":["post-1957571","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","stellar-product-taxonomy-events-calendar-pro"],"acf":[],"taxonomy_info":{"category":[{"value":1,"label":"Uncategorized"}],"stellar-product-taxonomy":[{"value":158,"label":"Events Calendar Pro"}]},"featured_image_src_large":["https:\/\/images.theeventscalendar.com\/kb\/uploads\/2023\/02\/social-share-1024x538.png",1024,538,true],"author_info":{"display_name":"Stephen Page","author_link":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/author\/stephen\/"},"comment_info":0,"category_info":[{"term_id":1,"name":"Uncategorized","slug":"uncategorized","term_group":0,"term_taxonomy_id":1,"taxonomy":"category","description":"","parent":0,"count":139,"filter":"raw","term_order":"0","cat_ID":1,"category_count":139,"category_description":"","cat_name":"Uncategorized","category_nicename":"uncategorized","category_parent":0}],"tag_info":false,"_links":{"self":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1957571","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=1957571"}],"version-history":[{"count":6,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1957571\/revisions"}],"predecessor-version":[{"id":1963298,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1957571\/revisions\/1963298"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media\/1955565"}],"wp:attachment":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=1957571"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=1957571"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=1957571"},{"taxonomy":"stellar-product-taxonomy","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/stellar-product-taxonomy?post=1957571"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}