Add custom stylesheet for Custom Post Types

I’ve created a custom archive page for a custom post type I’ve also created. I would like to style only this Custom Archive page. I’ve tried to create a function inside functions.php but it doesn’t work.

My question is : how do I use a custom stylesheet for this archive page and not on the other ones ?

Thanks

function interviewlist_style() {
if ( is_page_template('archive-interview.php') )
wp_enqueue_style('Archive Interviews', get_stylesheet_directory_uri() . '/css/archive_interviews.css');
}
add_action( 'wp_enqueue_scripts', 'interviewlist_style', 1);

Read more here: Add custom stylesheet for Custom Post Types

Leave a Reply

Your email address will not be published. Required fields are marked *