Используйте этот код
<?php
$args = array('post_type' => 'works', 'post_status' => 'publish', 'orderby' => 'post_id', 'order' => 'ASC');
$loop = new WP_Query( $args );
if( $loop->have_posts() )
{
while ( $loop->have_posts() )
{
$loop->the_post();
?>
<a href="https:www.mindificent.in" alt="mindificent" target="_blank">
<div class="item">
<div class="item-image">
<img src="img/items/item5.png" alt="" />
</div>
<div class="item-text">
<div class="item-text-wrap">
<p class="item-text-category"><?php echo the_title() ?></p>
<h2 class="item-text-title"><?php echo the_field('work_desc') ?></h2>
</div>
</div>
</div>
</a>
<?php
}
}
wp_reset_postdata();
?>
, если функция the_title () не работает, вы можете попробовать:
<p class="item-text-category"><?php echo get_the_title() ?></p>