How to add code to Header.php in a child theme?

I would hook into the wp_head action. I would place this in a plugin so as to abstract it from your presentation layer. This allows for scalability and changing of themes. This also prevents any analytics collateral damage if a step is missed in migration from one theme to the next. add_action(‘wp_head’, ‘wpse_43672_wp_head’); function wpse_43672_wp_head(){ … Read more

Why won’t wp_mail() let me set the From: header when plain old PHP mail() will?

Hi @helenyhou: You can set the header, just not with a parameter. WordPress uses “hooks” and the hooks you need are ‘wp_mail_from’ and ‘wp_mail_from_name’ hooks. Here are the hooks you might add to your theme’s functions.php file to modify the “From:” header when using wp_mail() to the email address Helen Hou-Sandi <[email protected]>: add_filter(‘wp_mail_from’,’yoursite_wp_mail_from’); function yoursite_wp_mail_from($content_type) … Read more