Home › Forums › Front-end Issues › Post Object: Selection does not show up in Custom Post Type › Reply To: Post Object: Selection does not show up in Custom Post Type
Hi @elliot,
I tried inserting
<?php global $post; echo $post->ID; ?>
and it gives me 862. But the post-id of the company-post-type is 240 (am I correct to say the post ID is the number in this URL: ../adm/wp-admin/post.php?post=240&action=edit )
If I am correct in the above 2 things, this means that ACF isnt loading the selected banners from the company’s post-id and instead some other post’s. I am a newbie at php, would be really grateful if you could let me know how I can modify my code in my banners.php (which is called in my single-company.php) which has the code that I pasted in my previous post.
EDIT: I have tried including the banners.php template INSIDE my loop and it works! Is there a way to make it work outside the loop, if I do not wish to create a secondary loop?
P/S. Thanks for helping me hone in on the root of the problem! xx
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
ACF’s Repeater field is a versatile solution for repeating content in #WordPress.
— Advanced Custom Fields (@wp_acf) December 29, 2022
What’s your favorite use case for the Repeater field?
What’s the weirdest thing you’ve ever used it for?
Let us know!👇
© 2023 Advanced Custom Fields.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.