{"id":1228063,"date":"2017-02-02T00:47:06","date_gmt":"2017-02-02T08:47:06","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/events-not-showing-in-blog-loop-2\/"},"modified":"2017-02-02T00:47:06","modified_gmt":"2017-02-02T08:47:06","slug":"events-not-showing-in-blog-loop-2","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/events-not-showing-in-blog-loop-2\/","title":{"rendered":"Events not showing in blog loop"},"content":{"rendered":"<p>Hi<br \/>\nI have a theme build by a company which is no longer in business and am trying to figure out why Events are not showing up in Main Page blog loop. (I have ticked off the option in Events Calendar Settings and read forum discussion which lead me to think that the code made by my developers may be a cause.) <\/p>\n<p>I have not tried to de-activate plugins or reverted to a the TwentyForuteen theme as the site is live. However, my guess is that the code below is the cause, and that some techie-wizards in this forum would spot the problem at a glance :-).  If not, I guess I have to de-activate and keep probing.<\/p>\n<p>I guess I found the loop (in page-5.php in the root of the theme folder) and would appreciate some help or pointers to a solution \ud83d\ude42 Thanks!<\/p>\n<p>\/\/ The Loop<br \/>\n\t\t\t\t\tif ( $the_query-&gt;have_posts() ) {<br \/>\n\t\t\t\t\t\t$postnr = 0;<br \/>\n\t\t\t\t\t\twhile ( $the_query-&gt;have_posts() ) {<br \/>\n\t\t\t\t\t\t$the_query-&gt;the_post();<br \/>\n\t\t\t\t\t\t$postnr++;<br \/>\n\t\t\t\t\t\t$frontpage_url = wp_get_attachment_image_src( get_post_thumbnail_id($post-&gt;ID), &#8216;nyhet-forside&#8217;);<br \/>\n\t\t\t\t\t\tif (!$frontpage_url[0]): $frontpage_url = wp_get_attachment_image_src( 5160, &#8216;nyhet-forside&#8217;); endif; ?&gt;<br \/>\n\t\t\t\t\t\t\t&lt;div class=&#8221;infoboks nyhet&#8221;&gt;<br \/>\n\t\t\t\t\t\t\t\t<a>&#8220;&gt;<br \/>\n\t\t\t\t\t\t\t\t\t<img \/>&#8221; width=&#8221;&lt;?php echo $frontpage_url[1]; ?&gt;&#8221; height=&#8221;&lt;?php echo $frontpage_url[2]; ?&gt;&#8221; \/&gt;<br \/>\n\t\t\t\t\t\t\t\t<\/a><br \/>\n\t\t\t\t\t\t\t\t<a>&#8220;&gt;<\/p>\n<h3>&lt;?php the_title(); ?&gt;<\/h3>\n<p><\/a><\/p>\n<p>&lt;?php echo wp_trim_excerpt(); ?&gt;<\/p>\n<p>\t\t\t\t\t\t\t\t<a>&#8221; class=&#8221;button&#8221;&gt;Les mer<\/a><br \/>\n\t\t\t\t\t\t\t\t&lt;?php if ( $postnr == 6 ) { ?&gt;<br \/>\n\t\t\t\t\t\t\t\t\t&lt;br \/&gt;<a>&#8221; class=&#8221;button more-posts&#8221;&gt;Se flere saker<\/a><br \/>\n\t\t\t\t\t\t\t\t&lt;?php } ?&gt;<br \/>\n\t\t\t\t\t\t\t&lt;\/div&gt;<br \/>\n\t\t\t\t\t\t&lt;?php }<br \/>\n\t\t\t\t\t} else {<br \/>\n\t\t\t\t\t\t\/\/ no posts found<\/p>\n","protected":false},"template":"","class_list":["post-1228063","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>Events not showing in blog loop -<\/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\/events-not-showing-in-blog-loop-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Events not showing in blog loop -\" \/>\n<meta property=\"og:description\" content=\"Hi I have a theme build by a company which is no longer in business and am trying to figure out why Events are not showing up in Main Page blog loop. (I have ticked off the option in Events Calendar Settings and read forum discussion which lead me to think that the code made [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/events-not-showing-in-blog-loop-2\/\" \/>\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\/events-not-showing-in-blog-loop-2\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/events-not-showing-in-blog-loop-2\/\",\"name\":\"Events not showing in blog loop -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2017-02-02T08:47:06+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/events-not-showing-in-blog-loop-2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/events-not-showing-in-blog-loop-2\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/events-not-showing-in-blog-loop-2\/#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\":\"Events not showing in blog loop\"}]},{\"@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":"Events not showing in blog loop -","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\/events-not-showing-in-blog-loop-2\/","og_locale":"en_US","og_type":"article","og_title":"Events not showing in blog loop -","og_description":"Hi I have a theme build by a company which is no longer in business and am trying to figure out why Events are not showing up in Main Page blog loop. (I have ticked off the option in Events Calendar Settings and read forum discussion which lead me to think that the code made [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/events-not-showing-in-blog-loop-2\/","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\/events-not-showing-in-blog-loop-2\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/events-not-showing-in-blog-loop-2\/","name":"Events not showing in blog loop -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2017-02-02T08:47:06+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/events-not-showing-in-blog-loop-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/events-not-showing-in-blog-loop-2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/events-not-showing-in-blog-loop-2\/#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":"Events not showing in blog loop"}]},{"@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\/1228063","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\/1228063\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1228063"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}