{"id":176704,"date":"2014-05-26T02:45:20","date_gmt":"2014-05-26T09:45:20","guid":{"rendered":"http:\/\/tri.be\/support\/forums\/topic\/page-event-titles\/"},"modified":"2014-05-28T10:02:23","modified_gmt":"2014-05-28T17:02:23","slug":"page-event-titles","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/page-event-titles\/","title":{"rendered":"Page \/ Event Titles"},"content":{"rendered":"<p>Hey guys, I had been using TEC 2.0.11 and found that page titles were not showing on my template. Barry provided the following code but it does not seem to work  with TEC 3 &#8211; I can&#8217;t figure it out as looking at the codex for this the filter seems to be correct so perhaps something has changed?<br \/>\nAny idea&#8217;s how I can modify this code to get things working once more?<br \/>\nThanks! (PS. I have this issue on the live site but am currently working on a local copy which has had everthing updated, the wordpress plugin shuffle does not indicate a conflict and reverting to version 2 brings back the titles so I guess it is just a problem with the function and version 3)<br \/>\n&#8212;&gt;<br \/>\n\t\/* The Events Calender &#8211; Use Template Title Area<br \/>\n\t================================================== *\/<\/p>\n<p>    add_filter(&#8216;the_title&#8217;, &#8216;tribe_restore_title&#8217;);<\/p>\n<p>    \/**<br \/>\n     * Tries to detect if the content is The Events Calendar related and returns the expected title. Useful where a theme<br \/>\n     * displays the post\/page title in a certain format before the event content is injected.<br \/>\n     *<br \/>\n     * Targets TEC 3.0.2. Notes: it looks on face value like better use could be made of tribe_is_event_query() and<br \/>\n     * tribe_is_event() here, but because we&#8217;re early in the request and want to avoid notices we&#8217;ll avoid those.<br \/>\n     *<br \/>\n     * @param $title<br \/>\n     * @return string<br \/>\n     *\/<br \/>\n    function tribe_restore_title($title) {<br \/>\n            global $wp_query;<br \/>\n            global $post;<\/p>\n<p>            if (-9999 !== $post-&gt;ID) return $title;<br \/>\n            if ( ! isset($wp_query-&gt;tribe_is_event) || ! $wp_query-&gt;tribe_is_event) return $title;<br \/>\n            if ( ! is_a($wp_query-&gt;posts[0], &#8216;WP_Post&#8217;) || $wp_query-&gt;posts[0]-&gt;ID == $post-&gt;ID) return $title;<\/p>\n<p>            if (is_singular()) return $wp_query-&gt;posts[0]-&gt;post_title;<br \/>\n            else return tribe_get_events_title();<br \/>\n    }<\/p>\n","protected":false},"template":"","class_list":["post-176704","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>Page \/ Event Titles -<\/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\/page-event-titles\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Page \/ Event Titles -\" \/>\n<meta property=\"og:description\" content=\"Hey guys, I had been using TEC 2.0.11 and found that page titles were not showing on my template. Barry provided the following code but it does not seem to work with TEC 3 &#8211; I can&#8217;t figure it out as looking at the codex for this the filter seems to be correct so perhaps [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/page-event-titles\/\" \/>\n<meta property=\"article:modified_time\" content=\"2014-05-28T17:02:23+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\/page-event-titles\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/page-event-titles\/\",\"name\":\"Page \/ Event Titles -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2014-05-26T09:45:20+00:00\",\"dateModified\":\"2014-05-28T17:02:23+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/page-event-titles\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/page-event-titles\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/page-event-titles\/#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\":\"Page \/ Event Titles\"}]},{\"@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":"Page \/ Event Titles -","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\/page-event-titles\/","og_locale":"en_US","og_type":"article","og_title":"Page \/ Event Titles -","og_description":"Hey guys, I had been using TEC 2.0.11 and found that page titles were not showing on my template. Barry provided the following code but it does not seem to work with TEC 3 &#8211; I can&#8217;t figure it out as looking at the codex for this the filter seems to be correct so perhaps [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/page-event-titles\/","article_modified_time":"2014-05-28T17:02:23+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\/page-event-titles\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/page-event-titles\/","name":"Page \/ Event Titles -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2014-05-26T09:45:20+00:00","dateModified":"2014-05-28T17:02:23+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/page-event-titles\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/page-event-titles\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/page-event-titles\/#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":"Page \/ Event Titles"}]},{"@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\/176704","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\/176704\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=176704"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}