Support » Plugins » hook the body tag

  • is there any way of using this code only on the frontend of wordpress and not in the backend?

    I get “YOUR INSERTED HTML GOES HERE” in the admin area also. which i dont want but i need to “hook” the body tag.

    function yoursite_template_include($template) {
    	return $template;
    function yoursite_shutdown() {
    	$insert =  "[YOUR INSERTED HTML GOES HERE]";
    	$content = ob_get_clean();
    	$content = preg_replace('#<body([^>]*)>#i',"<body$1>{$insert}",$content);
    	echo $content;
  • The topic ‘hook the body tag’ is closed to new replies.