Home › Forums › General Issues › ACF Within Loop › Reply To: ACF Within Loop
Sorry, there is nothing within the second code pasted because I’ve tried multiple times to add the
<?php if(get_field('pick_your_theme') == "LCBU Trends") { ?>
within the document and all it does is break the page layout as well as doesn’t filter correctly. The issue here is that how the theme author has created the page in one giant open PHP function rather than breaking it up (as in example code 1 above) where I can easily insert the selector get_field.
I’ve attached an attachment of the PHP document I am trying to edit so you can have a clear understanding.
The basic functionality is that I have built a custom field on every post to choose where to place the post. Thus, if they choose “Option A” in the post, then the code needs to check for that option to be true before passing all of the content related to the post (Title, Content, Images, etc.)
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.