So i have some custom attributes that defines a worker,the idea is to echo the name image and position attribute,and i have already done that.Now on click i want to display a small overlay that shows the name description and the 4 social links. this is how my php code looks like:
$query = new WP_Query( $args );
if ($query->have_posts()) :
echo '<div class="ov-worker--wrapper"><div class="ov-worker--modal"><ul>';
while ($query->have_posts()) : $query->the_post();
$name = get_post_meta( get_the_ID(), '_overview_worker_key', true )['name'] ?? '';
$image = get_post_meta( get_the_ID(), '_overview_worker_key', true )['image'] ?? '';
$position = get_post_meta( get_the_ID(), '_overview_worker_key', true )['position'] ?? '';
$description = get_post_meta( get_the_ID(), '_overview_worker_key', true )['description'] ?? '';
$Linkedin = get_post_meta( get_the_ID(), '_overview_worker_key', true )['Linkedin'] ?? '';
$github = get_post_meta( get_the_ID(), '_overview_worker_key', true )['github'] ?? '';
$xing = get_post_meta( get_the_ID(), '_overview_worker_key', true )['xing'] ?? '';
$facebook = get_post_meta( get_the_ID(), '_overview_worker_key', true )['facebook'] ?? '';
echo '<li class="ov-worker--view__all"><strong> Name: </strong>'.$name.'<br/><strong> Image: </strong>'.$image.'<br/><strong> Position: </strong>'.$position.'</li>';
endwhile;
echo '</ul></div></div>';
endif;
wp_reset_postdata();
MY PROBLEM: i am not able to select the $name, $description and the 4 social links directly in my js file. i have a not very clear idea of how to build the overlay on scss but i definetly got hooked on activating a Eventlistiner on the div to show the information i want.