I am writing a wordpress plugin and need to add some meta tags to the head section of the page from within my plugin. Does anyone know how I would do this?
Thanks
Yes you can add an action hook to wp_head
like this:
add_action('wp_head', myCallbackToAddMeta);
function myCallbacktoAddMeta(){
echo "\t<meta name='keywords' content='$contents' />\n";
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.