信息:我有一个表,其中存储了每个工人的以下信息(姓名、简短描述、人物形象、公司中的职位(如 CEO、项目经理、开发人员)社交网络链接:Github、Linkedin、Xing、Facebook) .
php:我有一个名为 wrapper 的 div 父级,在里面我有 2child div(一个用于带有工人信息的表,第二个 div(class =“info”)的想法是用所选信息覆盖表工人。)
$query = new WP_Query( $args );
if ($query->have_posts()) :
echo '<div class"wrapper"><div><table >';
echo '<tr>
<th>NAME</th>
<th>IMAGE</th>
<th>POSITION</th>
<th>MORE INFO</th>
</tr>';
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 '<tr class="ov-worker--table" ><td>'.$name.'</td><br/><td>'.$image.'</td><br/><td>'.$position.'</td><br/><td><button type="button" onclick="populateOverlay('.$name.','.$description.','.$facebook.')">More Info!</button></td></tr>';
endwhile;
echo '</table>
<div id="info"></div>
</div></div>';
endif;
wp_reset_postdata();
scss:
.wrapper {
position: fixed;
display: none;
width: 100%;
height: 100%;
top: 0;
left: 0;
right: 0;
bottom: 0;
//z-index: 2;
}
#info {
display: none;
position: absolute;
width: 25%;
height: 25%;
top: 0;
right: 0;
font-size: 12px;
color: rgb(128, 20, 20);
background-color: rgba(119, 107, 107, 0.5);
}
catspeake