How can I get the first post THIS SAME CATEGORY?

How can I get the first post THIS SAME CATEGORY? It’s just that now he takes the very first post that is generally in this type, but it is necessary that he takes the first post in the same category as the last if( get_adjacent_post(true, ”, true) ) { previous_post_link(‘%link’, ‘<div class=”navigation-portfolio-block”><h6 class=”arrow-left mobile_navigation”>Previous</h6></div> ‘);…

Details