Support

Account

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?