Home › Forums › General Issues › Using unique ID/Slug in template › Reply To: Using unique ID/Slug in template
Going back to your original code I see that you are doing a custom query inside of a function.
I’m pretty sure that you need to declare the global $post. Also, you may be in an nested loop already and if this is they case, using a standard have_post() loop in this function will not product the desired results. At this point I’m going to suggest starting your own topic. I have a feeling that this is about the function and the loops that get your here rather then then loops inside of the function.
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!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.