{"id":945932,"date":"2015-03-04T08:18:59","date_gmt":"2015-03-04T16:18:59","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/listing-events-for-one-year-almost-there\/"},"modified":"2015-04-30T04:57:19","modified_gmt":"2015-04-30T11:57:19","slug":"listing-events-for-one-year-almost-there","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/listing-events-for-one-year-almost-there\/","title":{"rendered":"Listing Events For One Year &#8211; Almost There"},"content":{"rendered":"<p>I&#8217;ve been struggling (I&#8217;m a newb) on how to have The Events Calendar print a list of all events within a specified year. I researched this need heavily online and I&#8217;m surprised that there&#8217;s limited info on the subject. The list is simple really. It just needs to be a linked title that sends the user to the actual event page.<\/p>\n<p>My approach was to create a custom [shortcode] in functions.php so I could place the list on any WordPress page or post that I need.<\/p>\n<p>The custom shortcode PHP is the following.<\/p>\n<p>\/\/ Setting up custom function called yearList<br \/>\nadd_shortcode(&#8216;yearList&#8217;, &#8216;yearList&#8217;);<br \/>\nfunction yearList()<br \/>\n{<\/p>\n<p>\/\/ Ensure the global $post variable is in scope<br \/>\nglobal $post;<\/p>\n<p>\/\/ Retrieve all events desired year. Only eight printed out of 80.<br \/>\n$events = tribe_get_events( array(<br \/>\n&#8216;eventDisplay&#8217; =&gt; &#8216;custom&#8217;,<br \/>\n&#8216;start_date&#8217;  =&gt; &#8216;2014-01-01 00:01&#8217;,<br \/>\n&#8216;end_date&#8217;    =&gt; &#8216;2014-12-31 23:59&#8217;<br \/>\n) );<\/p>\n<p>\/\/ Loop through the events: set up each one as<br \/>\n\/\/ the current post then use template tags to<br \/>\n\/\/ display the title and content<br \/>\nforeach ( $events as $post ) {<br \/>\nsetup_postdata( $post );<\/p>\n<p>\/\/ prints the title for each event.<br \/>\necho &#8216;&lt;br&gt;&lt;br&gt;&#8217;;<br \/>\n\/\/  WRONG WRONG &#8211; This is below is what&#8217;s throwing me.<br \/>\necho &#8216;<a>&#8221; title=&#8221;&lt;?php the_title() ?&gt;&#8221;&gt;<\/a>&#8216;;<br \/>\n\/\/the_title();<br \/>\n\/\/ echo tribe_get_start_date();  This shows the start date and time after the event title I slept this for now.<\/p>\n<p>}<br \/>\n}<\/p>\n<p>I have two questions.<\/p>\n<ul>\n<li>Why would the loop only show nine titles when I have over 80 stamped for 2014?<\/li>\n<li>How can make each line be a link to The Calendar Events actual event page? I&#8217;ve tried to employ this with no luck.<\/li>\n<\/ul>\n","protected":false},"template":"","class_list":["post-945932","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>Listing Events For One Year - Almost There -<\/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\/listing-events-for-one-year-almost-there\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Listing Events For One Year - Almost There -\" \/>\n<meta property=\"og:description\" content=\"I&#8217;ve been struggling (I&#8217;m a newb) on how to have The Events Calendar print a list of all events within a specified year. I researched this need heavily online and I&#8217;m surprised that there&#8217;s limited info on the subject. The list is simple really. It just needs to be a linked title that sends the [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/listing-events-for-one-year-almost-there\/\" \/>\n<meta property=\"article:modified_time\" content=\"2015-04-30T11:57:19+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\/listing-events-for-one-year-almost-there\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/listing-events-for-one-year-almost-there\/\",\"name\":\"Listing Events For One Year - Almost There -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2015-03-04T16:18:59+00:00\",\"dateModified\":\"2015-04-30T11:57:19+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/listing-events-for-one-year-almost-there\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/listing-events-for-one-year-almost-there\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/listing-events-for-one-year-almost-there\/#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\":\"Listing Events For One Year &#8211; Almost There\"}]},{\"@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":"Listing Events For One Year - Almost There -","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\/listing-events-for-one-year-almost-there\/","og_locale":"en_US","og_type":"article","og_title":"Listing Events For One Year - Almost There -","og_description":"I&#8217;ve been struggling (I&#8217;m a newb) on how to have The Events Calendar print a list of all events within a specified year. I researched this need heavily online and I&#8217;m surprised that there&#8217;s limited info on the subject. The list is simple really. It just needs to be a linked title that sends the [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/listing-events-for-one-year-almost-there\/","article_modified_time":"2015-04-30T11:57:19+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\/listing-events-for-one-year-almost-there\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/listing-events-for-one-year-almost-there\/","name":"Listing Events For One Year - Almost There -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2015-03-04T16:18:59+00:00","dateModified":"2015-04-30T11:57:19+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/listing-events-for-one-year-almost-there\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/listing-events-for-one-year-almost-there\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/listing-events-for-one-year-almost-there\/#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":"Listing Events For One Year &#8211; Almost There"}]},{"@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\/945932","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\/945932\/revisions"}],"predecessor-version":[{"id":945992,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/945932\/revisions\/945992"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=945932"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}