{"id":1252946,"date":"2017-03-11T10:36:38","date_gmt":"2017-03-11T18:36:38","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/showing-events-in-recent_posts\/"},"modified":"2017-03-11T10:36:38","modified_gmt":"2017-03-11T18:36:38","slug":"showing-events-in-recent_posts","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/showing-events-in-recent_posts\/","title":{"rendered":"Showing events in recent_posts"},"content":{"rendered":"<p>Hi there-<\/p>\n<p>I am trying to include events from the Events Calendar on my homepage. The theme I am using is &#8220;Prosperity&#8221;. The theme uses &#8220;recent_posts&#8221; to display new blog posts on the homepage.<\/p>\n<p>&#8211; I updated my settings in the events calendar to &#8220;Include events in main blog loop&#8221;<br \/>\n&#8211; I added code to my child theme to merge the events into the main rss feed (which seems to work)<br \/>\nhttps:\/\/theeventscalendar.com\/knowledgebase\/customize-rss-feed\/<\/p>\n<p>My thought was that I needed to update the &#8220;post_type&#8221; in my php file for the theme to incorporate &#8220;tribe_events&#8221;  in addition  to &#8220;post&#8221; but so far I&#8217;ve had no luck.<\/p>\n<p>\t$recent_args = array(<br \/>\n\t\t&#8216;post_type&#8217; =&gt; &#8216;post&#8217;,&#8217;tribe_events&#8217;,<br \/>\n\t\t&#8216;posts_per_page&#8217; =&gt; absint( get_theme_mod( &#8216;prosperity_front_recent_posts_number&#8217;, &#8216;6&#8217; ) ),<br \/>\n\t\t&#8216;ignore_sticky_posts&#8217; =&gt; 1,<br \/>\n\t\t&#8216;no_found_rows&#8217; =&gt; true,<\/p>\n<p>here is the PHP code from the template that generates recent posts.<\/p>\n<p>$recent_posts = new WP_Query( $recent_args );<\/p>\n<p>\tif ( $recent_posts-&gt;have_posts() ) : ?&gt;<\/p>\n<p>\t&lt;section class=&#8221;front-block front-blog-posts&#8221;&gt;<br \/>\n\t\t&lt;div class=&#8221;container&#8221;&gt;<\/p>\n<p>\t\t\t&lt;?php if ( &#8221; != $section_title || &#8221; != $section_content ) : ?&gt;<br \/>\n\t\t\t&lt;div class=&#8221;front-block-header&#8221;&gt;<br \/>\n\t\t\t\t&lt;?php if ( &#8221; != $section_title ) : ?&gt;<\/p>\n<h3>&lt;?php echo esc_html( $section_title ); ?&gt;<\/h3>\n<p>\t\t\t\t&lt;?php endif; ?&gt;<\/p>\n<p>\t\t\t\t&lt;?php if ( &#8221; != $section_content ) : ?&gt;<br \/>\n\t\t\t\t&lt;div class=&#8221;front-block-content&#8221;&gt;<br \/>\n\t\t\t\t\t&lt;?php echo convert_chars( wptexturize( stripslashes( wp_filter_post_kses( addslashes( $section_content ) ) ) ) ); \/\/ WPCS: XSS OK. ?&gt;<br \/>\n\t\t\t\t&lt;\/div&gt;&lt;!&#8211; .front-block-content &#8211;&gt;<br \/>\n\t\t\t\t&lt;?php endif; ?&gt;<br \/>\n\t\t\t&lt;\/div&gt;&lt;!&#8211; .front-block-header &#8211;&gt;<br \/>\n\t\t\t&lt;?php endif; ?&gt;<\/p>\n<p>\t\t\t&lt;div class=&#8221;row recent-posts-row&#8221;&gt;<br \/>\n\t\t\t&lt;?php while ( $recent_posts-&gt;have_posts() ) : $recent_posts-&gt;the_post(); ?&gt;<\/p>\n<p>\t\t\t\t&lt;div class=&#8221;col-lg-4 recent-post&#8221;&gt;<br \/>\n\t\t\t\t&lt;?php get_template_part( &#8216;template-parts\/front-page\/content\/recent&#8217;, &#8216;post&#8217; ); ?&gt;<br \/>\n\t\t\t\t&lt;\/div&gt;&lt;!&#8211; .recent-post &#8211;&gt;<\/p>\n<p>\t\t\t&lt;?php endwhile; ?&gt;<br \/>\n\t\t\t&lt;\/div&gt;&lt;!&#8211; .row.recent-posts-row &#8211;&gt;<\/p>\n<p>\t\t\t&lt;?php wp_reset_postdata(); ?&gt;<\/p>\n<p>do you have any guidance on how I might proceed? <\/p>\n<p>Thank you,<\/p>\n","protected":false},"template":"","class_list":["post-1252946","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>Showing events in recent_posts -<\/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\/showing-events-in-recent_posts\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Showing events in recent_posts -\" \/>\n<meta property=\"og:description\" content=\"Hi there- I am trying to include events from the Events Calendar on my homepage. The theme I am using is &#8220;Prosperity&#8221;. The theme uses &#8220;recent_posts&#8221; to display new blog posts on the homepage. &#8211; I updated my settings in the events calendar to &#8220;Include events in main blog loop&#8221; &#8211; I added code to [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/showing-events-in-recent_posts\/\" \/>\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=\"2 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\/showing-events-in-recent_posts\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/showing-events-in-recent_posts\/\",\"name\":\"Showing events in recent_posts -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2017-03-11T18:36:38+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/showing-events-in-recent_posts\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/showing-events-in-recent_posts\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/showing-events-in-recent_posts\/#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\":\"Showing events in recent_posts\"}]},{\"@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":"Showing events in recent_posts -","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\/showing-events-in-recent_posts\/","og_locale":"en_US","og_type":"article","og_title":"Showing events in recent_posts -","og_description":"Hi there- I am trying to include events from the Events Calendar on my homepage. The theme I am using is &#8220;Prosperity&#8221;. The theme uses &#8220;recent_posts&#8221; to display new blog posts on the homepage. &#8211; I updated my settings in the events calendar to &#8220;Include events in main blog loop&#8221; &#8211; I added code to [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/showing-events-in-recent_posts\/","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/showing-events-in-recent_posts\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/showing-events-in-recent_posts\/","name":"Showing events in recent_posts -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2017-03-11T18:36:38+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/showing-events-in-recent_posts\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/showing-events-in-recent_posts\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/showing-events-in-recent_posts\/#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":"Showing events in recent_posts"}]},{"@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\/1252946","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\/1252946\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1252946"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}