W3 Total Cache – ACF /PHP Variables
-
Hi, I’ve managed to get the Page Fragment Cache block running okay, but noticed that I can’t seem to run any if/else logic against a php, or acf, field variable and I was wondering if this is perhaps just because of the life-cycle of how the page fragment caching works?
For example I currently have this on my page:-
<!– mfunc mysecuritystring –>
if( get_field( ‘my_acf_field’ ) ){
echo ‘hello world’;
}<!– mfunc mysecuritystring –>
But the get_field always return null…and the echo is never printed to the screen…
However if I just var_dump the get_field value in normal php tags it will return true
Many thanks
The topic ‘W3 Total Cache – ACF /PHP Variables’ is closed to new replies.