Title: post_parent returning 0
Last modified: September 23, 2026

---

# post_parent returning 0

 *  Resolved [galeo](https://wordpress.org/support/users/galeo/)
 * (@galeo)
 * [1 week, 2 days ago](https://wordpress.org/support/topic/post_parent-returning-0/)
 * Hi there,
 * I followed a tutorial on the PODS framework and created a custom post type called‘
   product’ with four fields “info”, “weight”, “price” and “images”, and three different
   products.
 * Then I created two templates, one for each individual product and another for
   a list of products. On the ‘product’ archive page, I choiced in the list template‘
   images’ and ‘price’ fields. I tried to create a link from the image to the product
   detail page using the following code
 *     ```wp-block-code
       [each immagini]    <p class="immagini--prodotto"><a href="{@post_parent,get_the_permalink}"><img src="{@guid}"></a></p>[/each]
       ```
   
 * by following the instructions in the tutorial. The link, however, points to a
   page that doesn’t exist.
 * Furthermore, I noticed in the `wp_posts` table, in the `post_parent` field, an
   index value ‘14’, 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…
 * I’ve seen what’s have been written at the page [https://docs.pods.io/displaying-pods/image-media-fields-reference/](https://docs.pods.io/displaying-pods/image-media-fields-reference/#page-header-1347)
   and I think the tutorial refers to this page. But I think that’s no longer the
   case, or am I wrong?
 * Thank you in advance,
 * Claudio

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Support [pd](https://wordpress.org/support/users/pdclark/)
 * (@pdclark)
 * [1 week, 2 days ago](https://wordpress.org/support/topic/post_parent-returning-0/#post-19027620)
 * If `14` is the ID for the correct post which the link should go to, for your 
   post type product, then verify you have configured the post type to use the default
   WordPress permalink structure and templates:
 * In Pods “Advanced Options” tab for the post type: “Public” and “Publicly Queryable”
   should be checked. This would usually be the cause of a 404. You may also need
   to save Permalinks in WP Admin > Settings > Permalinks after changing this.
 *  Thread Starter [galeo](https://wordpress.org/support/users/galeo/)
 * (@galeo)
 * [1 week, 1 day ago](https://wordpress.org/support/topic/post_parent-returning-0/#post-19028137)
 * Thank you [@pdclark](https://wordpress.org/support/users/pdclark/),
 * I followed your instructions. The default WordPress permalink structure and templates
   is configured, in Pods “Advanced Options” tab for the post type, “Public” and“
   Publicly Queryable” are checked.
 * Now, I’m looking for an explanation. In the table wp_posts ID 14 corresponds 
   to the ID of the form used to create the three ‘products’. This ID is the same
   as the one that appears in the ‘post_parent’ field for product posts and their
   associated images. And it’s the same I see in the 404 URL [http://podslab.local/prodotto/14](http://podslab.local/prodotto/14)
   when I try to click on the image on the archive page with the three products.
 * On the other hand, the link in the title of each individual product is correct
   and leads to the product details page [http://podslab.local/prodotto/vecchi-libri/](http://podslab.local/prodotto/vecchi-libri/).
 * I don’t understand…
 *  
 *  Thread Starter [galeo](https://wordpress.org/support/users/galeo/)
 * (@galeo)
 * [1 week ago](https://wordpress.org/support/topic/post_parent-returning-0/#post-19028978)
 * I verified making another kind of content.
 * I created other three objects with another “pods” through a form. In the “post_parent”
   field every record made with the form (text or images) have taken the ID of the
   form, as in the previous example. In the archive page the URL generated with 
   the magic tags `@post_parent ` on the images ends with that ID, but the link 
   leads to a page that does not exist.
 * It’s a real brain-teaser…
 *  Plugin Support [pd](https://wordpress.org/support/users/pdclark/)
 * (@pdclark)
 * [1 week ago](https://wordpress.org/support/topic/post_parent-returning-0/#post-19029195)
 * Are you using the `form="1"` attribute of the pods shortcode? See [https://docs.pods.io/displaying-pods/pods-shortcode/](https://docs.pods.io/displaying-pods/pods-shortcode/)
 *  Thread Starter [galeo](https://wordpress.org/support/users/galeo/)
 * (@galeo)
 * [1 week ago](https://wordpress.org/support/topic/post_parent-returning-0/#post-19029346)
 * No, I’m not using it… I created the form using the menu New page > Control panel
   > Pods form. I don’t use shortcode in this case.
 *  Plugin Support [pd](https://wordpress.org/support/users/pdclark/)
 * (@pdclark)
 * [1 week ago](https://wordpress.org/support/topic/post_parent-returning-0/#post-19029353)
 * So you are using the Pods Form block, not a third party form? And it is set to
   create a new post object, not edit the current page? Try again with shortcode
   explicitly specifying creation of your target post type (Pod name), or join the
   plugin support Slack channel, where more detailed code can be shared for the 
   multi-step workflow
 *  Thread Starter [galeo](https://wordpress.org/support/users/galeo/)
 * (@galeo)
 * [1 week ago](https://wordpress.org/support/topic/post_parent-returning-0/#post-19029421)
 * Thank you so mutch [@pdclark](https://wordpress.org/support/users/pdclark/),
 * now I’m sure I’ll use the Pods Form block, not a third party form.

Viewing 7 replies - 1 through 7 (of 7 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fpost_parent-returning-0%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/pods/assets/icon.svg?rev=3286397)
 * [Pods - Custom Content Types and Fields](https://wordpress.org/plugins/pods/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pods/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pods/)
 * [Active Topics](https://wordpress.org/support/plugin/pods/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pods/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pods/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [galeo](https://wordpress.org/support/users/galeo/)
 * Last activity: [1 week ago](https://wordpress.org/support/topic/post_parent-returning-0/#post-19029421)
 * Status: resolved