{"id":942965,"date":"2015-02-17T04:08:06","date_gmt":"2015-02-17T12:08:06","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/post_type-post\/"},"modified":"2015-02-17T07:50:06","modified_gmt":"2015-02-17T15:50:06","slug":"post_type-post","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/post_type-post\/","title":{"rendered":"&#039;post_type&#039; =&gt; &#039;post&#039;"},"content":{"rendered":"<p>Hi,<\/p>\n<p>i&#8217;m am using The Event Calendar and before paying the Pro licence i&#8217;ve just a case to be cleared..<\/p>\n<p>When i setup an event (new or update one) i had some custom fields like Facebook link, website link, twitter link&#8230; and a custom fiel idCategory to be able to join an event to the posts wich are in the idCategory.<br \/>\nThat is to say, when i&#8217;m looking an event; i want to have the last posts speaking about the event.<\/p>\n<p>I&#8217;ve wrote this code<br \/>\nif ($custom[&#8216;idCategory&#8217;][0]) {<br \/>\n  \t\t\t\t\t$args = array( &#8216;post_type&#8217; =&gt; &#8216;post&#8217;,&#8217;posts_per_page&#8217; =&gt; 10, &#8216;cat&#8217; =&gt; $custom[&#8216;idCategory&#8217;][0] );<br \/>\n  \t\t\t\t\t$my_query = new wp_query($args);<br \/>\n  \t\t\t\t\tif( $my_query-&gt;have_posts() ) { echo &#8221;; while ($my_query-&gt;have_posts()) { $my_query-&gt;the_post();<br \/>\nSHOW POST<br \/>\n}<\/p>\n<p>The trouble is that, even if $custom[&#8216;idCategory&#8217;][0] return the good idCategory, wp_query returns no row and in fact the query is looking for post_type= TribeEvents !<\/p>\n<p>there is nearly the same issu as in my website, on right side i have a widget calling the last-randomize-maxview posts<br \/>\nlook right here<br \/>\nhttp:\/\/www.adonnante.com\/calendrier\/<\/p>\n<p>When i am in an event page<br \/>\nhttp:\/\/www.adonnante.com\/epreuve\/extreme-sailing-series-2015-acte-2-mascate-oman-11-14-mars\/<br \/>\nthe right last-randomize-bestviuw posts show EVENTS and no POST !!!!<\/p>\n<p>The two issues are the same i think, but i don&#8217;t find the way to corrected them.<\/p>\n<p>Thanks for your help.<\/p>\n<p>Regards<\/p>\n<p>Gilles<\/p>\n","protected":false},"template":"","class_list":["post-942965","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>&#039;post_type&#039; =&gt; &#039;post&#039; -<\/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\/post_type-post\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"&#039;post_type&#039; =&gt; &#039;post&#039; -\" \/>\n<meta property=\"og:description\" content=\"Hi, i&#8217;m am using The Event Calendar and before paying the Pro licence i&#8217;ve just a case to be cleared.. When i setup an event (new or update one) i had some custom fields like Facebook link, website link, twitter link&#8230; and a custom fiel idCategory to be able to join an event to the [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/post_type-post\/\" \/>\n<meta property=\"article:modified_time\" content=\"2015-02-17T15:50:06+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\/post_type-post\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/post_type-post\/\",\"name\":\"&#039;post_type&#039; =&gt; &#039;post&#039; -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2015-02-17T12:08:06+00:00\",\"dateModified\":\"2015-02-17T15:50:06+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/post_type-post\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/post_type-post\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/post_type-post\/#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\":\"&#039;post_type&#039; =&gt; &#039;post&#039;\"}]},{\"@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":"&#039;post_type&#039; =&gt; &#039;post&#039; -","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\/post_type-post\/","og_locale":"en_US","og_type":"article","og_title":"&#039;post_type&#039; =&gt; &#039;post&#039; -","og_description":"Hi, i&#8217;m am using The Event Calendar and before paying the Pro licence i&#8217;ve just a case to be cleared.. When i setup an event (new or update one) i had some custom fields like Facebook link, website link, twitter link&#8230; and a custom fiel idCategory to be able to join an event to the [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/post_type-post\/","article_modified_time":"2015-02-17T15:50:06+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\/post_type-post\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/post_type-post\/","name":"&#039;post_type&#039; =&gt; &#039;post&#039; -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2015-02-17T12:08:06+00:00","dateModified":"2015-02-17T15:50:06+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/post_type-post\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/post_type-post\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/post_type-post\/#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":"&#039;post_type&#039; =&gt; &#039;post&#039;"}]},{"@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\/942965","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\/942965\/revisions"}],"predecessor-version":[{"id":942974,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/942965\/revisions\/942974"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=942965"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}