{"id":1020820,"date":"2015-11-02T08:04:00","date_gmt":"2015-11-02T16:04:00","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/integrate-events-with-blog\/"},"modified":"2015-11-16T13:12:03","modified_gmt":"2015-11-16T21:12:03","slug":"integrate-events-with-blog","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/integrate-events-with-blog\/","title":{"rendered":"Integrate events with blog"},"content":{"rendered":"<p>Trying to get events integrated with blog posts by following suggestions on another thread.<\/p>\n<p>add_action( \u2018pre_get_posts\u2019, events_in_main_query\u2019 );<br \/>\nfunction events_in_main_query( $query ) {<\/p>\n<p>if (  $query-&gt;is_main_query() ) {<br \/>\n$query-&gt;set( \u2018post_type\u2019, array( \u2018post\u2019, \u2018tribe_events\u2019) ); return $query;<br \/>\n}<\/p>\n<p>}<\/p>\n<p>Using Genesis and only references to blog is this in loops.php (see below) &#8211; I&#8217;m not sure what needs to replace main_query with to make it work.<\/p>\n<p>function genesis_do_loop() {<\/p>\n<p>\tif ( is_page_template( &#8216;page_blog.php&#8217; ) ) {<\/p>\n<p>\t\t$include = genesis_get_option( &#8216;blog_cat&#8217; );<br \/>\n\t\t$exclude = genesis_get_option( &#8216;blog_cat_exclude&#8217; ) ? explode( &#8216;,&#8217;, str_replace( &#8216; &#8216;, &#8221;, genesis_get_option( &#8216;blog_cat_exclude&#8217; ) ) ) : &#8221;;<br \/>\n\t\t$paged   = get_query_var( &#8216;paged&#8217; ) ? get_query_var( &#8216;paged&#8217; ) : 1;<\/p>\n<p>\t\t\/\/* Easter Egg<br \/>\n\t\t$query_args = wp_parse_args(<br \/>\n\t\t\tgenesis_get_custom_field( &#8216;query_args&#8217; ),<br \/>\n\t\t\tarray(<br \/>\n\t\t\t\t&#8216;cat&#8217;              =&gt; $include,<br \/>\n\t\t\t\t&#8216;category__not_in&#8217; =&gt; $exclude,<br \/>\n\t\t\t\t&#8216;showposts&#8217;        =&gt; genesis_get_option( &#8216;blog_cat_num&#8217; ),<br \/>\n\t\t\t\t&#8216;paged&#8217;            =&gt; $paged,<br \/>\n\t\t\t)<br \/>\n\t\t);<\/p>\n<p>\t\tgenesis_custom_loop( $query_args );<br \/>\n\t} else {<br \/>\n\t\tgenesis_standard_loop();<br \/>\n\t}<\/p>\n<p>}<\/p>\n<p>to view site while under construction: parentsinpartnership.net\/parents<\/p>\n","protected":false},"template":"","class_list":["post-1020820","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>Integrate events with blog -<\/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\/integrate-events-with-blog\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Integrate events with blog -\" \/>\n<meta property=\"og:description\" content=\"Trying to get events integrated with blog posts by following suggestions on another thread. add_action( \u2018pre_get_posts\u2019, events_in_main_query\u2019 ); function events_in_main_query( $query ) { if ( $query-&gt;is_main_query() ) { $query-&gt;set( \u2018post_type\u2019, array( \u2018post\u2019, \u2018tribe_events\u2019) ); return $query; } } Using Genesis and only references to blog is this in loops.php (see below) &#8211; I&#8217;m not sure [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/integrate-events-with-blog\/\" \/>\n<meta property=\"article:modified_time\" content=\"2015-11-16T21:12:03+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\/integrate-events-with-blog\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/integrate-events-with-blog\/\",\"name\":\"Integrate events with blog -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2015-11-02T16:04:00+00:00\",\"dateModified\":\"2015-11-16T21:12:03+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/integrate-events-with-blog\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/integrate-events-with-blog\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/integrate-events-with-blog\/#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\":\"Welcome!\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/_welcome\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Pre-Sales Questions\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/_welcome\/pre-sales-questions\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Integrate events with blog\"}]},{\"@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":"Integrate events with blog -","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\/integrate-events-with-blog\/","og_locale":"en_US","og_type":"article","og_title":"Integrate events with blog -","og_description":"Trying to get events integrated with blog posts by following suggestions on another thread. add_action( \u2018pre_get_posts\u2019, events_in_main_query\u2019 ); function events_in_main_query( $query ) { if ( $query-&gt;is_main_query() ) { $query-&gt;set( \u2018post_type\u2019, array( \u2018post\u2019, \u2018tribe_events\u2019) ); return $query; } } Using Genesis and only references to blog is this in loops.php (see below) &#8211; I&#8217;m not sure [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/integrate-events-with-blog\/","article_modified_time":"2015-11-16T21:12:03+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\/integrate-events-with-blog\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/integrate-events-with-blog\/","name":"Integrate events with blog -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2015-11-02T16:04:00+00:00","dateModified":"2015-11-16T21:12:03+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/integrate-events-with-blog\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/integrate-events-with-blog\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/integrate-events-with-blog\/#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":"Welcome!","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/_welcome\/"},{"@type":"ListItem","position":4,"name":"Pre-Sales Questions","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/_welcome\/pre-sales-questions\/"},{"@type":"ListItem","position":5,"name":"Integrate events with blog"}]},{"@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\/1020820","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\/1020820\/revisions"}],"predecessor-version":[{"id":1020828,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1020820\/revisions\/1020828"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1020820"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}