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


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: