<?php 
    if (have_posts()): ?>
	        <div class=" clear">
			
			    <div class="post_siswa">
				
				    <table class="press_tab">
					    <tr class="top_tab">
						    <td><?php echo __('Nama', 'prestasi'); ?></td>
							<td><?php echo __('NIK', 'prestasi'); ?></td>
							<td><?php echo __('Kelas', 'prestasi'); ?></td>
						</tr>
						
	                    <?php while (have_posts()): the_post(); 
						    global $post;
							$nisn = get_post_meta($post->ID, '_nisn', true);
							?>
						    <tr>
						        <td><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></td>
								<td><?php echo esc_html( $nisn ); ?></td>
								<td>
								    <?php 
					                    $terms = get_the_terms( $post->ID , 'kelas' );
										if ( $terms != null ){
											foreach( $terms as $term ) {
												$term_link = get_term_link( $term, 'kelas');
												echo '<a href="' . $term_link . '">' . $term->name . '</a> ';
												unset($term); 
											} 
										} 
									?>
								</td>
					    	</tr>
						<?php endwhile; ?>
						
					</table>
					
				</div>
				
			</div>
        <?php 
	endif; 
?>