How to Write Custom CSS Specifically for Certain Page Templates in WordPress

First published 10 April 2015

This article is from our archive. It is kept as it was first written, so some steps or versions may be out of date.

If you want to add custom css for a specific page template, you can use is page template function in the header in if condition and write the corresponding css as the sample below.


if (is_page_template('album.php')) {
echo '

';
}
?>