{"id":999577,"date":"2015-08-27T07:49:28","date_gmt":"2015-08-27T14:49:28","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/related-events-not-showing-their-custom-fields-and-excerpts\/"},"modified":"2015-08-31T15:54:27","modified_gmt":"2015-08-31T22:54:27","slug":"related-events-not-showing-their-custom-fields-and-excerpts","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/related-events-not-showing-their-custom-fields-and-excerpts\/","title":{"rendered":"Related events not showing their custom fields and excerpts."},"content":{"rendered":"<p>Hello, I&#8217;m trying to pull in extra information for the related events feed at the bottom of the individual event page. However, they just display the information relating to the event page that they are being used on. For example, I want to be able to get the event taxonomy, the event custom fields, and the cost of the event. Below is the code that I have modified in the related-events.php file in the pro plugin:<\/p>\n<pre><code>&lt;?php foreach ( $posts as $post ) : ?&gt;\n\t\t\t&lt;?php setup_postdata($post); ?&gt;\n\t\t\t&lt;li&gt;\n\t\t\t\t&lt;div class=&quot;tribe-related-event-info list-event-inner&quot;&gt;\n\t\t\t\t\t&lt;div class=&quot;top-info-wrap&quot; data-equalizer-watch&gt;\n\t\t\t\t\t\t&lt;?php\n\t\t\t\t\t\t\t$reltags = get_the_tags($post-&gt;ID);\n\t\t\t\t\t\t\tif($reltags){\n\t\t\t\t\t\t\t\t$rtcount = count($reltags);\n\t\t\t\t\t\t\t\t$rtccount = 1;\n\t\t\t\t\t\t\t\techo &#039;&lt;p class=&quot;course-tags&quot;&gt;&#039;;\n\t\t\t\t\t\t\t\tforeach ($reltags as $reltag) {\n\t\t\t\t\t\t\t\t\techo $reltag-&gt;name;\n\t\t\t\t\t\t\t\t\t$rtccount++;\n\t\t\t\t\t\t\t\t\tif($rtccount &lt; $rtcount) {\n\t\t\t\t\t\t\t\t\t\techo &#039;, &#039;;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\techo &#039;&lt;\/p&gt;&#039;;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t?&gt;\n\t\t\t\t\t\t&lt;?php $thisun = $post-&gt;ID; ?&gt;\n\t\t\t\t\t\t&lt;h3 class=&quot;tribe-related-events-title summary&quot;&gt;&lt;a href=&quot;&lt;?php echo tribe_get_event_link( $post ); ?&gt;&quot; class=&quot;url&quot; rel=&quot;bookmark&quot;&gt;&lt;?php echo get_the_title( $post-&gt;ID ); ?&gt;&lt;\/a&gt;&lt;\/h3&gt;\n\t\t\t\t\t\t&lt;p class=&quot;entry-summary&quot;&gt;&lt;?php echo get_post($thisun)-&gt;post_excerpt; ?&gt;&lt;\/p&gt;\n\t\t\t\t\t&lt;\/div&gt;\n\t\t\t\t\t&lt;ul class=&quot;detail-list&quot;&gt;\n\t\t\t\t\t\t&lt;li&gt;\n\t\t\t\t\t\t\t&lt;div class=&quot;icon-holder&quot;&gt;\n\t\t\t\t\t\t\t\t&lt;i class=&quot;fa fa-briefcase&quot;&gt;&lt;\/i&gt;\n\t\t\t\t\t\t\t&lt;\/div&gt;\n\t\t\t\t\t\t\t&lt;?php\n\t\t\t\t\t\t\t$professions = tribe_get_event_taxonomy($thisun);\n\t\t\t\t\t\t\t$professions = str_replace(&#039;&lt;\/li&gt;&lt;li&gt;&#039;,&#039;, &#039;,$professions);\n\t\t\t\t\t\t\t$professions = strip_tags($professions);\n\t\t\t\t\t\t\t?&gt;\n\t\t\t\t\t\t\t&lt;p&gt;&lt;?php if($professions){ echo $professions; } else { echo &#039;TBC&#039;; }?&gt;&lt;\/p&gt;\n\t\t\t\t\t\t&lt;\/li&gt;\n\t\t\t\t\t\t&lt;li&gt;\n\t\t\t\t\t\t\t&lt;?php $fields = tribe_get_custom_fields($thisun); ?&gt;\n\t\t\t\t\t\t\t&lt;div class=&quot;icon-holder&quot;&gt;\n\t\t\t\t\t\t\t\t&lt;i class=&quot;fa fa-hourglass-o&quot;&gt;&lt;\/i&gt;\n\t\t\t\t\t\t\t&lt;\/div&gt;\n\t\t\t\t\t\t\t&lt;?php $duration = $fields[&#039;Duration&#039;] ?&gt;\n\t\t\t\t\t\t\t&lt;p&gt;&lt;?php if($duration) { echo $duration; } else { echo &#039;TBC&#039;; } ?&gt;&lt;\/p&gt;\n\t\t\t\t\t\t&lt;\/li&gt;\n\t\t\t\t\t\t&lt;li&gt;\n\t\t\t\t\t\t\t&lt;div class=&quot;icon-holder&quot;&gt;\n\t\t\t\t\t\t\t\t&lt;i class=&quot;fa fa-money&quot;&gt;&lt;\/i&gt;\n\t\t\t\t\t\t\t&lt;\/div&gt;\n\t\t\t\t\t\t\t&lt;?php $thecost = tribe_get_cost( null, true ); ?&gt;\n\t\t\t\t\t\t\t&lt;?php if ($thecost) { echo &#039;&lt;p&gt;&#039; . $thecost . &#039;&lt;\/p&gt;&#039;; } else { echo &#039;&lt;p&gt;TBC&lt;\/p&gt;&#039;; } ?&gt;\n\t\t\t\t\t\t&lt;\/li&gt;\n\t\t\t\t\t&lt;\/ul&gt;\n\t\t\t\t&lt;\/div&gt;\n\t\t\t&lt;\/li&gt;\n\t\t\t&lt;?php endforeach; ?&gt;<\/code><\/pre>\n<p>The event posts are custom post types aren&#8217;t they? Would it be better to use wp_query and specify the custom post type? I managed to get the excerpt by getting the whole post object but it seems a bit heavy handed.<\/p>\n<p>Many thanks for any information that points me in the right direction. I&#8217;m essentially wanting to access all the post information I can access when in the list view.<\/p>\n","protected":false},"template":"","class_list":["post-999577","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>Related events not showing their custom fields and excerpts. -<\/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\/related-events-not-showing-their-custom-fields-and-excerpts\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Related events not showing their custom fields and excerpts. -\" \/>\n<meta property=\"og:description\" content=\"Hello, I&#8217;m trying to pull in extra information for the related events feed at the bottom of the individual event page. However, they just display the information relating to the event page that they are being used on. For example, I want to be able to get the event taxonomy, the event custom fields, and [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/related-events-not-showing-their-custom-fields-and-excerpts\/\" \/>\n<meta property=\"article:modified_time\" content=\"2015-08-31T22:54:27+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\/related-events-not-showing-their-custom-fields-and-excerpts\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/related-events-not-showing-their-custom-fields-and-excerpts\/\",\"name\":\"Related events not showing their custom fields and excerpts. -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2015-08-27T14:49:28+00:00\",\"dateModified\":\"2015-08-31T22:54:27+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/related-events-not-showing-their-custom-fields-and-excerpts\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/related-events-not-showing-their-custom-fields-and-excerpts\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/related-events-not-showing-their-custom-fields-and-excerpts\/#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\":\"Related events not showing their custom fields and excerpts.\"}]},{\"@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":"Related events not showing their custom fields and excerpts. -","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\/related-events-not-showing-their-custom-fields-and-excerpts\/","og_locale":"en_US","og_type":"article","og_title":"Related events not showing their custom fields and excerpts. -","og_description":"Hello, I&#8217;m trying to pull in extra information for the related events feed at the bottom of the individual event page. However, they just display the information relating to the event page that they are being used on. For example, I want to be able to get the event taxonomy, the event custom fields, and [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/related-events-not-showing-their-custom-fields-and-excerpts\/","article_modified_time":"2015-08-31T22:54:27+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\/related-events-not-showing-their-custom-fields-and-excerpts\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/related-events-not-showing-their-custom-fields-and-excerpts\/","name":"Related events not showing their custom fields and excerpts. -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2015-08-27T14:49:28+00:00","dateModified":"2015-08-31T22:54:27+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/related-events-not-showing-their-custom-fields-and-excerpts\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/related-events-not-showing-their-custom-fields-and-excerpts\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/related-events-not-showing-their-custom-fields-and-excerpts\/#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":"Related events not showing their custom fields and excerpts."}]},{"@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\/999577","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\/999577\/revisions"}],"predecessor-version":[{"id":999623,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/999577\/revisions\/999623"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=999577"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}