{"id":19027609,"date":"2026-09-23T16:52:18","date_gmt":"2026-09-23T16:52:18","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/post_parent-returning-0\/"},"modified":"2026-09-23T16:52:18","modified_gmt":"2026-09-23T16:52:18","slug":"post_parent-returning-0","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/post_parent-returning-0\/","title":{"rendered":"post_parent returning 0"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hi there,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I followed a tutorial on the PODS framework and created a custom post type called \u2018product\u2019 with four fields &#8220;info&#8221;, &#8220;weight&#8221;, &#8220;price&#8221; and &#8220;images&#8221;, and three different products.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then I created two templates, one for each individual product and another for a list of products. On the \u2018product\u2019 archive page, I choiced in the list template \u2018images\u2019 and \u2018price\u2019 fields. I tried to create a link from the image to the product detail page using the following code<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;each immagini]    <br \/>&lt;p class=\"immagini--prodotto\"&gt;&lt;a href=\"{@post_parent,get_the_permalink}\"&gt;&lt;img src=\"{@guid}\"&gt;&lt;\/a&gt;&lt;\/p&gt;<br \/>&#091;\/each]<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">by following the instructions in the tutorial. The link, however, points to a page that doesn&#8217;t exist. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Furthermore, I noticed in the\u00a0<code>wp_posts<\/code>\u00a0table, in the\u00a0<code>post_parent<\/code>\u00a0field, an index value \u201814\u2019, which is passed to the URL, creating the link to the page that does not exist, as mentioned earlier. In the tutorial, the link seems to work. Unfortunately, I have tried several times without success&#8230;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I&#8217;ve seen what&#8217;s have been written at the page <a href=\"https:\/\/docs.pods.io\/displaying-pods\/image-media-fields-reference\/#page-header-1347\">https:\/\/docs.pods.io\/displaying-pods\/image-media-fields-reference\/<\/a> and I think the tutorial refers to this page. But I think that\u2019s no longer the case, or am I wrong?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you in advance,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Claudio<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"template":"","class_list":["post-19027609","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19027609","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19027609\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=19027609"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}