Hot answers tagged

1

Yes too early is probably why, the global $post variable is not populated yet. Try hooking to a later action (I think init at the very least): add_action('wp_enqueue_scripts','enqueue_product_styles'); function enqueue_product_styles() { if (get_post_type() == 'product'){ wp_enqueue_style( 'css_products.css', ...



Only top voted, non community-wiki answers of a minimum length are eligible