How can I show the title when a checkbox is checked. I use Advanced custom fields
my field name is nav
This is what i currently have.
<?php if(get_field('nav')) { ?>
<li> <a href="<?php the_permalink()?>" class="active"><?php the_title();?></a>
</li>
<?php } ?>
nav
field returns exactly what? what type of field is it..? please tryvar_dump(get_field('nav'));
the_title()
, and why is it in ali
element? Are there multiple titles?truthy
(i.e. the checkbox is checked in a page edit screen) value. Otherwise the condition isfalse
and the title would not be displayed. What doesvar_dump(get_field('nav'));
give you if you have the checkbox checked in a page edit screen?