Home › Forums › Front-end Issues › If checkbox ticked then add a class › Reply To: If checkbox ticked then add a class
Starting to make more sense. Thanks for sticking with me on this one.
Only problem is the thumbnail <a>
isn’t written in a way that I can just add your code.
<?php
$args = array(
'post_type' => 'Videos'
);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
echo '<div class="grid-item thumb ';
foreach (get_the_terms(get_the_ID(), 'category') as $cat) { echo $cat->slug . ' '; }
echo '"><a href="';
the_field('vid_url');
echo '" data-lity data-director="';
foreach (get_the_terms(get_the_ID(), 'director') as $cat) { echo $cat->name; }
echo '" data-title="';
the_title();
echo '">';
the_post_thumbnail();
echo '</a></div>';
endwhile;
?>
So what you’re saying is: it checks if the T/F value is Signed and adds the class “issigned” to the above <a>
. Then, if you click on an <a>
that has the class “issigned”, that will in turn add a class to <div class="lity-data">
? Is that what you’re thinking?
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.