{"id":1159242,"date":"2016-09-02T07:18:13","date_gmt":"2016-09-02T14:18:13","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-would-like-to-display-event-list-order-by-event-title\/"},"modified":"2016-09-02T07:18:13","modified_gmt":"2016-09-02T14:18:13","slug":"i-would-like-to-display-event-list-order-by-event-title","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-would-like-to-display-event-list-order-by-event-title\/","title":{"rendered":"I would like to display event list order by event title."},"content":{"rendered":"<p>I would like to display event list order by event title. I have tried below code. Unfortunately, it doesn&#8217;t work. Can you please help me for this,<\/p>\n<p>add_filter( &#8216;pre_get_posts&#8217;, &#8216;tribe_change_event_order&#8217;, 99 );<br \/>\nfunction tribe_change_event_order( $query ) {<br \/>\n    if ( tribe_is_past() || tribe_is_upcoming()) {<br \/>\n        $query-&gt;set( &#8216;orderby&#8217;, &#8216;title&#8217; );<br \/>\n        $query-&gt;set( &#8216;order&#8217;, &#8216;DESC&#8217; );<\/p>\n<p>    }<br \/>\n    return $query;<br \/>\n}<\/p>\n","protected":false},"template":"","class_list":["post-1159242","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>I would like to display event list order by event title. -<\/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\/i-would-like-to-display-event-list-order-by-event-title\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"I would like to display event list order by event title. -\" \/>\n<meta property=\"og:description\" content=\"I would like to display event list order by event title. I have tried below code. Unfortunately, it doesn&#8217;t work. Can you please help me for this, add_filter( &#8216;pre_get_posts&#8217;, &#8216;tribe_change_event_order&#8217;, 99 ); function tribe_change_event_order( $query ) { if ( tribe_is_past() || tribe_is_upcoming()) { $query-&gt;set( &#8216;orderby&#8217;, &#8216;title&#8217; ); $query-&gt;set( &#8216;order&#8217;, &#8216;DESC&#8217; ); } return $query; }\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-would-like-to-display-event-list-order-by-event-title\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-would-like-to-display-event-list-order-by-event-title\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-would-like-to-display-event-list-order-by-event-title\/\",\"name\":\"I would like to display event list order by event title. -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2016-09-02T14:18:13+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-would-like-to-display-event-list-order-by-event-title\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-would-like-to-display-event-list-order-by-event-title\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-would-like-to-display-event-list-order-by-event-title\/#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\":\"I would like to display event list order by event title.\"}]},{\"@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":"I would like to display event list order by event title. -","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\/i-would-like-to-display-event-list-order-by-event-title\/","og_locale":"en_US","og_type":"article","og_title":"I would like to display event list order by event title. -","og_description":"I would like to display event list order by event title. I have tried below code. Unfortunately, it doesn&#8217;t work. Can you please help me for this, add_filter( &#8216;pre_get_posts&#8217;, &#8216;tribe_change_event_order&#8217;, 99 ); function tribe_change_event_order( $query ) { if ( tribe_is_past() || tribe_is_upcoming()) { $query-&gt;set( &#8216;orderby&#8217;, &#8216;title&#8217; ); $query-&gt;set( &#8216;order&#8217;, &#8216;DESC&#8217; ); } return $query; }","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-would-like-to-display-event-list-order-by-event-title\/","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-would-like-to-display-event-list-order-by-event-title\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-would-like-to-display-event-list-order-by-event-title\/","name":"I would like to display event list order by event title. -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2016-09-02T14:18:13+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-would-like-to-display-event-list-order-by-event-title\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-would-like-to-display-event-list-order-by-event-title\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-would-like-to-display-event-list-order-by-event-title\/#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":"I would like to display event list order by event title."}]},{"@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\/1159242","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":0,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1159242\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1159242"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}