I created a page template named custpage.php I also created a separate css file named style2.css to style the custpage which has html and php code. The page templates loads fine it shows under the page attributes but the css stylesheet doesn't seem to work.
This is what I did in functions.php
function register_cust_style() {
if ( is_page_template( 'custpage.php' ) ) {
wp_enqueue_style( 'vega', get_stylesheet_directory_uri() . '/style2.css' );
}
}
add_action( 'wp_enqueue_scripts', 'register_cust_style' );
The css file is inside vega/style2.css (where vega is name of the template directory).