{"id":1966574,"date":"2025-09-02T05:45:09","date_gmt":"2025-09-02T09:45:09","guid":{"rendered":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/?p=1966574"},"modified":"2025-09-02T05:45:10","modified_gmt":"2025-09-02T09:45:10","slug":"how-to-move-subscription-options-in-calendar-views-and-single-event-pages","status":"publish","type":"post","link":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/how-to-move-subscription-options-in-calendar-views-and-single-event-pages\/","title":{"rendered":"How to Move Subscription Options in Calendar Views and Single Event Pages"},"content":{"rendered":"\n<p>If you\u2019d like to reorder the subscription options that appear in the <strong>Subscribe<\/strong> dropdown on your calendar (for example, showing <strong>iCal<\/strong> first instead of <strong>Google Calendar<\/strong>), you can do this with a simple snippet.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-why-you-might-want-this\">Why You Might Want This<\/h2>\n\n\n\n<p>By default, the calendar sets its own order for subscription options. Some sites may prefer to highlight a specific platform (like iCal) for their audience. With a filter, you can easily adjust which option appears first.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-the-snippet\">The Snippet<\/h2>\n\n\n\n<p>Add the following code to your site. You can place it in your theme\u2019s <strong>functions.php<\/strong> file via <strong>Appearance \u2192 Theme File Editor<\/strong>, or for a safer option, use the <a href=\"https:\/\/wordpress.org\/plugins\/code-snippets\/\">Code Snippets plugin<\/a>.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n\/**\n * Reorder the subscribe links to place iCal first.\n *\n * @param array $subscribe_links An array of subscribe\/export link objects.\n * @return array The reordered array of subscribe\/export link objects.\n *\/\nfunction my_custom_reorder_subscribe_links( array $subscribe_links ): array {\n    $target= null;\n\n    \/\/ Check if the &#039;ical&#039; item exists and remove it from its current position.\n    if ( isset( $subscribe_links&#x5B;&#039;ical&#039;] ) ) {\n        $target= $subscribe_links&#x5B;&#039;ical&#039;];\n        unset( $subscribe_links&#x5B;&#039;ical&#039;] );\n    }\n\n    \/\/ If the &#039;ical&#039; item was found, add it to the beginning of the array.\n    if ( null !== $target) {\n        $subscribe_links = &#x5B; &#039;ical&#039; =&gt; $target] + $subscribe_links;\n    }\n\n    return $subscribe_links;\n}\nadd_filter( &#039;tec_views_v2_subscribe_links&#039;, &#039;my_custom_reorder_subscribe_links&#039;, 10 );\n\n<\/pre><\/div>\n\n\n<p>This will move the <strong>iCal<\/strong> option to the top of the dropdown.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-customizing-other-options\">Customizing Other Options<\/h2>\n\n\n\n<p>If you\u2019d like to move a different option to the top, simply replace <code>'ical'<\/code> in the snippet with one of these keys:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>gcal<\/code> = Google Calendar<\/li>\n\n\n\n<li><code>outlook-365<\/code> = Outlook 365<\/li>\n\n\n\n<li><code>outlook-live<\/code> = Outlook Live<\/li>\n\n\n\n<li><code>ics<\/code> = ICS<\/li>\n\n\n\n<li><code>outlook-ics<\/code> = Outlook ICS file<\/li>\n<\/ul>\n\n\n\n<p>For example, if you want <strong>Google Calendar<\/strong> to appear first, replace every instance of <code>ical<\/code> with <code>gcal<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-best-practices\">Best Practices<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Always test snippets on a staging site before applying them to your live site.<\/li>\n\n\n\n<li>See our guide on <a href=\"https:\/\/staging.theeventscalendar.com\/knowledgebase\/best-practices-for-implementing-custom-code-snippets\/\">best practices for implementing custom code snippets<\/a> for more tips.<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you\u2019d like to reorder the subscription options that appear in the Subscribe dropdown on your calendar (for example, showing iCal first instead of Google Calendar), you can do this with a simple snippet. Why You Might Want This By default, the calendar sets its own order for subscription options. Some sites may prefer to&#8230;<\/p>\n","protected":false},"author":64,"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":[24,59,79,84],"tags":[25],"stellar-product-taxonomy":[],"class_list":["post-1966574","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-customizing","category-customizing-resources","category-snippets","category-theming-overview","tag-customizations"],"acf":[],"taxonomy_info":{"category":[{"value":24,"label":"Customizations"},{"value":59,"label":"PHP &amp; Functions"},{"value":79,"label":"Snippets"},{"value":84,"label":"Templating &amp; Layout"}],"post_tag":[{"value":25,"label":"Customizations"}]},"featured_image_src_large":["https:\/\/images.theeventscalendar.com\/kb\/uploads\/2023\/02\/social-share-1024x538.png",1024,538,true],"author_info":{"display_name":"Jes","author_link":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/author\/jes\/"},"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":110,"filter":"raw","term_order":"0","cat_ID":24,"category_count":110,"category_description":"","cat_name":"Customizations","category_nicename":"customizing","category_parent":0},{"term_id":59,"name":"PHP &amp; Functions","slug":"customizing-resources","term_group":0,"term_taxonomy_id":59,"taxonomy":"category","description":"","parent":24,"count":101,"filter":"raw","term_order":"0","cat_ID":59,"category_count":101,"category_description":"","cat_name":"PHP &amp; Functions","category_nicename":"customizing-resources","category_parent":24},{"term_id":79,"name":"Snippets","slug":"snippets","term_group":0,"term_taxonomy_id":79,"taxonomy":"category","description":"","parent":0,"count":136,"filter":"raw","term_order":"0","cat_ID":79,"category_count":136,"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}],"tag_info":[{"term_id":25,"name":"Customizations","slug":"customizations","term_group":0,"term_taxonomy_id":25,"taxonomy":"post_tag","description":"","parent":0,"count":177,"filter":"raw","term_order":"0"}],"_links":{"self":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1966574","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\/64"}],"replies":[{"embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=1966574"}],"version-history":[{"count":3,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1966574\/revisions"}],"predecessor-version":[{"id":1966577,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1966574\/revisions\/1966577"}],"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=1966574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=1966574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=1966574"},{"taxonomy":"stellar-product-taxonomy","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/stellar-product-taxonomy?post=1966574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}