I want to add my own <meta />
tag inside the <head></head>
container on every page or post within the loop()
.
Is that possible?
What hook(s) should I use for that?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityto hook in the <head>
you would use wp_head
. You can read the documentation here.
add_action( 'wp_head', 'meta_example' );
function meta_example() {
echo '<meta name="description" content="Meta Description for this Page." />';
} // End meta_example()
This assumes that your theme has <?php wp_head(); ?>
in the <head>
.
wp_head