{"id":1027815,"date":"2015-11-18T20:10:04","date_gmt":"2015-11-19T04:10:04","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/all-instances-of-recurring-events-are-showing-on-the-home-page-above-recent-news\/"},"modified":"2016-02-18T08:31:47","modified_gmt":"2016-02-18T16:31:47","slug":"all-instances-of-recurring-events-are-showing-on-the-home-page-above-recent-news","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/all-instances-of-recurring-events-are-showing-on-the-home-page-above-recent-news\/","title":{"rendered":"All instances of recurring events are showing on the home page above recent news"},"content":{"rendered":"<p>I installed the update to .6 in my development site (http:\/\/dev.stcwdc.org\/) before installing it in my production site (http:\/\/events.stcwdc.org\/). Unfortunately, the latest update to .6 has messed up the order of events shown on the home page again.<\/p>\n<p>My home page shows the calendar and the collection of posts from the news posts and from the event posts. They are supposed to be displayed in the order written \/ published so that news posts are not pushed down below all future events. Having all future event posts take priority is not necessary\u2013the upcoming events are listed in order in the sidebar widget. I need our recent news at the top.  This was working with snippets from previous tickets but since the latest update, all instances of future recurring events are showing and some recent news posts are not showing (Competition deadline extended&#8230;), which show in the production site before the update.<\/p>\n<p>To see before update and after update results, compare the following PDFs.<\/p>\n<p>Production site working correctly before update to .6:<br \/>\nhttp:\/\/dev.stcwdc.org\/wp-content\/uploads\/WDCB-Events-News-before-update-18nov15.pdf<\/p>\n<p>Development site not working correctly after update to .6:<br \/>\nhttp:\/\/dev.stcwdc.org\/wp-content\/uploads\/WDCB-Development-after-update-18nov15.pdf<\/p>\n<p>I want all posts listed in the order they were published regardless if they are an event or a news post. In other words if two future events will occur one to two weeks from now, I want them listed below the news post I just wrote yesterday. Sometimes the news posts are about one of those future events, or it is important that users see it right away and not have to scroll through all future events to get to the current news posts.<\/p>\n<p>To accomplish this, I have been given snippets for the functions.php page but these stopped working in the previous releases. To fix that, I was advised to uncheck the \u201cRecurring event instances\u201d to get the functions working again as desired. <\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"qzgc6QePk7\"><p><a href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/posts-are-getting-posted-in-the-wrong-order\/\">Posts are getting posted in the wrong order.<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;Posts are getting posted in the wrong order.&#8221; &#8212; \" src=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/posts-are-getting-posted-in-the-wrong-order\/embed\/#?secret=djskYtJINm#?secret=qzgc6QePk7\" data-secret=\"qzgc6QePk7\" width=\"580\" height=\"327\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>The update to .6 has kept the \u201cRecurring event instances\u201d unchecked but the functions to order the posts in the correct order and to only show one instance of recurring events are not working. The following are the function snippets I have that once worked:<\/p>\n<p>&lt;?php<br \/>\n\/\/<br \/>\n\/\/ *************************************<br \/>\n\/\/ Events Calendar fix<br \/>\n\/\/ Sort Events posts by creation \/ published date rather than start date<br \/>\n\/\/ from Geoff&#8217;s second code in ticket at<br \/>\n\/\/ https:\/\/theeventscalendar.com\/support\/forums\/topic\/posts-are-getting-posted-in-the-wrong-order\/<br \/>\n\/\/ NOTE: The &#8220;Recurring events instances&#8221; setting must be unchecked in the settings for this to work. Otherwise,<br \/>\n\/\/ the two top functions just reorders future events to the top&#8211;with all the recent news posts below the future<br \/>\n\/\/ events.<br \/>\n\/\/ [If the &#8220;Recurring events instances&#8221; is checked on, the code lists all post categories starting with April 2007.<br \/>\n\/\/ When the box is unchecked, I get what I want&#8211;all posts ordered by the date published &#8211;intermixing event posts<br \/>\n\/\/ with news posts.]<br \/>\n\/\/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br \/>\n\/\/<\/p>\n<p>add_action( &#8216;pre_get_posts&#8217;, &#8216;tribe_post_date_ordering&#8217;, 51 );<\/p>\n<p>function tribe_post_date_ordering( $query ) {<br \/>\nif ( $query-&gt;tribe_is_multi_posttype) {<br \/>\nremove_filter( &#8216;posts_fields&#8217;, array( &#8216;Tribe__Events__Query&#8217;, &#8216;multi_type_posts_fields&#8217; ) ); $query-&gt;set( &#8216;order&#8217;, &#8216;DESC&#8217; );<br \/>\n}<br \/>\n}<\/p>\n<p>add_action( &#8216;pre_get_posts&#8217;, &#8216;custom_teardown_tribe_order_filter&#8217;, 60 );<\/p>\n<p>function custom_teardown_tribe_order_filter() {<br \/>\nif ( is_feed() ) remove_filter( &#8216;posts_orderby&#8217;, array( &#8216;Tribe__Events__Query&#8217;, &#8216;posts_orderby&#8217; ), 10, 2 );<br \/>\n}<\/p>\n<p>add_action( &#8216;pre_get_posts&#8217;, &#8216;order_by_modified&#8217; );<\/p>\n<p>function order_by_modified( $query ) {<\/p>\n<p>  if ( $query-&gt;is_home() &amp;&amp; $query-&gt;is_main_query() ) {<\/p>\n<p>   $query-&gt;set( &#8216;orderby&#8217;, &#8216;modified&#8217; );<br \/>\n  }<br \/>\n}<br \/>\n?&gt;<\/p>\n<p>If I go into the settings and check the &#8220;Recurring events instances&#8221; box back on, I am back at the original problems I had earlier where the home page shows &#8220;Nothing Found<br \/>\nApologies, but no results were found for the requested archive. Perhaps searching will help find a related post.&#8221; instead of the calendar and news and event posts.<\/p>\n<p>I unchecked the box again but what do I need to do to get this to work as desired again?<\/p>\n","protected":false},"template":"","class_list":["post-1027815","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>All instances of recurring events are showing on the home page above recent news -<\/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\/all-instances-of-recurring-events-are-showing-on-the-home-page-above-recent-news\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"All instances of recurring events are showing on the home page above recent news -\" \/>\n<meta property=\"og:description\" content=\"I installed the update to .6 in my development site (http:\/\/dev.stcwdc.org\/) before installing it in my production site (http:\/\/events.stcwdc.org\/). Unfortunately, the latest update to .6 has messed up the order of events shown on the home page again. My home page shows the calendar and the collection of posts from the news posts and from [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/all-instances-of-recurring-events-are-showing-on-the-home-page-above-recent-news\/\" \/>\n<meta property=\"article:modified_time\" content=\"2016-02-18T16:31:47+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=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/all-instances-of-recurring-events-are-showing-on-the-home-page-above-recent-news\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/all-instances-of-recurring-events-are-showing-on-the-home-page-above-recent-news\/\",\"name\":\"All instances of recurring events are showing on the home page above recent news -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2015-11-19T04:10:04+00:00\",\"dateModified\":\"2016-02-18T16:31:47+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/all-instances-of-recurring-events-are-showing-on-the-home-page-above-recent-news\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/all-instances-of-recurring-events-are-showing-on-the-home-page-above-recent-news\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/all-instances-of-recurring-events-are-showing-on-the-home-page-above-recent-news\/#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\":\"All instances of recurring events are showing on the home page above recent news\"}]},{\"@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":"All instances of recurring events are showing on the home page above recent news -","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\/all-instances-of-recurring-events-are-showing-on-the-home-page-above-recent-news\/","og_locale":"en_US","og_type":"article","og_title":"All instances of recurring events are showing on the home page above recent news -","og_description":"I installed the update to .6 in my development site (http:\/\/dev.stcwdc.org\/) before installing it in my production site (http:\/\/events.stcwdc.org\/). Unfortunately, the latest update to .6 has messed up the order of events shown on the home page again. My home page shows the calendar and the collection of posts from the news posts and from [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/all-instances-of-recurring-events-are-showing-on-the-home-page-above-recent-news\/","article_modified_time":"2016-02-18T16:31:47+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/all-instances-of-recurring-events-are-showing-on-the-home-page-above-recent-news\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/all-instances-of-recurring-events-are-showing-on-the-home-page-above-recent-news\/","name":"All instances of recurring events are showing on the home page above recent news -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2015-11-19T04:10:04+00:00","dateModified":"2016-02-18T16:31:47+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/all-instances-of-recurring-events-are-showing-on-the-home-page-above-recent-news\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/all-instances-of-recurring-events-are-showing-on-the-home-page-above-recent-news\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/all-instances-of-recurring-events-are-showing-on-the-home-page-above-recent-news\/#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":"All instances of recurring events are showing on the home page above recent news"}]},{"@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\/1027815","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\/1027815\/revisions"}],"predecessor-version":[{"id":1028194,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1027815\/revisions\/1028194"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1027815"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}