fdomagro
Member
Posted 11 months ago #
I'm writing a plugin to add metadata to posts and pages, so I need to change the header. In my specific case, I which to do it on-the-fly, so I'm not looking for the add_post_meta() function.
I read add_action to wp_head would do it, but it depends on theme authors, and I didn't want my plugin to fail in some themes.
Thanks.
I didn't want my plugin to fail in some themes.
I wouldn't worry about that too much, those themes that don't include wp_head() will not work with LOTS of plugins. ;)
If you want, you could hook into
add_action( 'loop_start' , 'your_function_here' );
But loops run all the time and wouldn't get into the head portion. Depending on your code, that trick may not work.