While I’ve never heard of the plugin before now, their documentation is pretty straight forward. Give this a shot:
<?php
$lists = get_field('lists');
$spcl = get_sub_field('spcl');
if( ($lists) && ($spcl) )
{
echo '<p>POOP!</p>';
}
?>
Thanks, but no dice.
w/ my solution and this i can get it to work if i cam only calling for the ‘lists’ field, but once i also ask for the sub_field ….nope :/ GRF!
Again, thanks though!
Without seeing the rest of the code, I’d say that since it’s a repeating field, it’s probably being stored in an array and thus has to be broken out with a foreach.
What do you get when you try to echo out the conditional functions?
<?php
echo get_field('lists');
echo get_sub_field('spcl');
?>
Do you get values for both? Also, does it maybe not process the HTML markup? Try removing the paragraph tags?
Good luck lady! Feel free to shoot me credentials via email or whatever if you don’t figure it out within a couple hours. Should be home from work by then and available to toy with it.
You’re gonna want to look at this documentation, as you’re on a repeater field (which is inherently different):
http://www.advancedcustomfields.com/docs/code-examples/#wpshdo_7
So you’d do something like …
$lists = get_field( 'lists' );
if( $lists ){
foreach( $lists as $list ){
if( $list['spcl'] ){
echo '<p>POOP!</p>';
}
}
}
it should trigger once for each instance of the repeater field, if spcl isn’t blank
Hey Dudes! Was JUST now able to get back to working on this and George, you win today!
Thanks to all of you! <3
Oh yeah, that too. George wins!