If you are new in Wordpress and looking to fetch any specific post data. Please review the code below::
//Here we are going to fetch post named Vacancy.
$args = array('post_type' => 'Vacancy');
$loop = new WP_Query( $args);
//WQ_QUERY is a wordpress function
//Define loop to fetch all data under vacany post type
$inc = 0;
while ( $loop->have_posts() ) :
$loop->the_post();
$postId = $post->ID; //Fetch Post ID
$inc++;
?>
<tr>
<td>
<?php echo $inc; // Display row number ?>
</td>
<td>
<strong><?php the_title(); //Display post title ?></strong>
</td>
<td>
<?php the_excerpt(); //Display short description of post ?>
</td>
<td>
<?php the_content(); //Display post content ?>
</td>
</tr>
<?php endwhile; ?>
0 Comment(s)