WordPress Add Style Tag Into Head Programmatically

Note: If you have used single quotes (‘) in your CSS then you must need to add a backslash (\) before every single quote.

<?php
add_action('wp_head', 'Custom_Styles', 100);
function Custom_Styles() {
    echo '
	<style>
        //Your CSS
	</style>
	';
}
?>

Leave a Comment

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