{"id":1023577,"date":"2015-11-09T20:44:19","date_gmt":"2015-11-10T04:44:19","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/how-to-customize-the-upcoming-events-loop\/"},"modified":"2016-02-18T08:31:51","modified_gmt":"2016-02-18T16:31:51","slug":"how-to-customize-the-upcoming-events-loop","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/how-to-customize-the-upcoming-events-loop\/","title":{"rendered":"How to customize the upcoming events loop"},"content":{"rendered":"<p>Hello!<\/p>\n<p>I am using The Events Calendar plugin to display calendar events on an accounting website. The trick is that the client wants the events that fall on the same day to be listed together. And, if possible, to only show the upcoming 2 months. For example,<\/p>\n<blockquote><p><strong>Nov. 10, 2015<\/strong><br \/>\nAccelerated payroll deductions<\/p>\n<p><strong>Nov. 15, 2015<\/strong><br \/>\nRegular payroll deductions<\/p>\n<p><strong>Nov. 20, 2015<\/strong><br \/>\nCanada Child Tax Benefit<\/p>\n<p><strong>Nov. 30, 2015<\/strong><br \/>\nCorporate tax installments<br \/>\nCorporate tax returns<br \/>\nUniversal Child Care Benefit<\/p><\/blockquote>\n<p>I was able to create a loop that shows my events, but they are all shown individually with the date for each:<\/p>\n<pre><code>&lt;?php query_posts(array( &#039;post_type&#039; =&gt; &#039;tribe_events&#039; ) ); \nwhile (have_posts()) : the_post(); $url = esc_url( get_permalink( tribe_get_venue_id( $post-&gt;ID))); ?&gt;\n    &lt;h3&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;\/a&gt;&lt;\/h3&gt;\n    &lt;p&gt;&lt;?php echo tribe_get_start_date($post-&gt;ID, true, $format = &#039;F j, Y - l&#039; );?&gt;&lt;br&gt;\n&lt;?php echo tribe_get_venue_link()?&gt;&lt;\/p&gt;   \n&lt;?php endwhile;?&gt;<\/code><\/pre>\n<p>So it outputs:<\/p>\n<blockquote><p><strong>Accelerated payroll deductions <\/strong><br \/>\nNovember 10, 2015 &#8211; Tuesday<\/p>\n<p><strong>Regular payroll deductions <\/strong><br \/>\nNovember 15, 2015 &#8211; Sunday<\/p>\n<p><strong>Canada Child Tax Benefit <\/strong><br \/>\nNovember 20, 2015 &#8211; Friday<\/p><\/blockquote>\n<p>And so on! Can you please help me with this loop so I can show my events grouped by date, and possibly have a function that shows automatically the next two months&#8217; worth of events?<\/p>\n<p>Thanks!!!<\/p>\n","protected":false},"template":"","class_list":["post-1023577","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to customize the upcoming events loop -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/how-to-customize-the-upcoming-events-loop\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to customize the upcoming events loop -\" \/>\n<meta property=\"og:description\" content=\"Hello! I am using The Events Calendar plugin to display calendar events on an accounting website. The trick is that the client wants the events that fall on the same day to be listed together. And, if possible, to only show the upcoming 2 months. For example, Nov. 10, 2015 Accelerated payroll deductions Nov. 15, [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/how-to-customize-the-upcoming-events-loop\/\" \/>\n<meta property=\"article:modified_time\" content=\"2016-02-18T16:31:51+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/how-to-customize-the-upcoming-events-loop\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/how-to-customize-the-upcoming-events-loop\/\",\"name\":\"How to customize the upcoming events loop -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2015-11-10T04:44:19+00:00\",\"dateModified\":\"2016-02-18T16:31:51+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/how-to-customize-the-upcoming-events-loop\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/how-to-customize-the-upcoming-events-loop\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/how-to-customize-the-upcoming-events-loop\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Events Calendar PRO\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"How to customize the upcoming events loop\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to customize the upcoming events loop -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/how-to-customize-the-upcoming-events-loop\/","og_locale":"en_US","og_type":"article","og_title":"How to customize the upcoming events loop -","og_description":"Hello! I am using The Events Calendar plugin to display calendar events on an accounting website. The trick is that the client wants the events that fall on the same day to be listed together. And, if possible, to only show the upcoming 2 months. For example, Nov. 10, 2015 Accelerated payroll deductions Nov. 15, [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/how-to-customize-the-upcoming-events-loop\/","article_modified_time":"2016-02-18T16:31:51+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/how-to-customize-the-upcoming-events-loop\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/how-to-customize-the-upcoming-events-loop\/","name":"How to customize the upcoming events loop -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2015-11-10T04:44:19+00:00","dateModified":"2016-02-18T16:31:51+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/how-to-customize-the-upcoming-events-loop\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/how-to-customize-the-upcoming-events-loop\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/how-to-customize-the-upcoming-events-loop\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Events Calendar PRO","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/"},{"@type":"ListItem","position":5,"name":"How to customize the upcoming events loop"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1023577","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1023577\/revisions"}],"predecessor-version":[{"id":1023980,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1023577\/revisions\/1023980"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1023577"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}