Created
January 4, 2019 12:48
-
-
Save FesoVel/c60cd8727948e536b094b1d8e21e21c5 to your computer and use it in GitHub Desktop.
How to add html code to WordPress <head> using wp_head hook.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function insert_html_in_header() { | |
echo '<<< html here >>>'; | |
} | |
/* Admin Dashboard */ | |
add_action( 'admin_head', 'insert_html_in_header' ); | |
/* Front End */ | |
add_action( 'wp_head', 'insert_html_in_header' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you're developing a theme, you can add this code to the
functions.php
file of your theme.