Last post in loop – custom post types August 28, 2022 by Tarik Billa Your template file should be named archive-[post_type].php. Check out the template hierarchy.