Moving Function to Header..
-
Hi guys,
I’m trying to move some PHP code from my Functions.php to my Header.php.
function hello() { global $post; if (!is_single()) { return; } //print_r($post); $pony = strip_tags($post->post_content); $pony = str_replace(array('"',"'", "\n", "\r", "\t"), ''', $pony); echo "$pony"; } add_action('wp_head', 'hello');I’ve tried:
<?PHP { global $post; if (!is_single()) { return; } //print_r($post); $pony = strip_tags($post->post_content); $pony = str_replace(array('"',"'", "\n", "\r", "\t"), ''', $pony); echo "$pony"; } ;?>etc.. But this doesn’t work.
Any help would be much appreciated.
Thanks,
Lou
The topic ‘Moving Function to Header..’ is closed to new replies.