Nevermind, I got it resolved. For reference, anywhere I declared $queried_object
I replaced with $taxonomy . '_' . $term_id
For example:
<?php if( get_field('header_image_cat', $queried_object) ) { ?>
should read:
<?php if( get_field('header_image_cat', $taxonomy . '_' . $term_id) ) { ?>
Disregard. I had to add <?php global $post; ?>
to the code and it worked.
Additionally, if I assign $location
above with $location = "Hey!"
it works fine. It does not work if I use the get_field
function.
Of course it’s written right there. I completely overlooked it! But thanks for the followup!
You’re right. Appeared to be a caching issue with WPEngine.
Thanks!
Nevermind, just got it all figured out. Thanks!
If I utilize the code linked below, adding the code of:
`if(get_field(‘pick_your_theme’) != “MacroForces”){ continue; }’
it doesn’t seem to pass the selector value and still pulls all posts, regardless if they are marked as MacroForces or not.
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.