Help with PHP in Wordpress

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
NickinChicago
Forum Newbie
Posts: 1
Joined: Wed Sep 08, 2010 3:21 pm

Help with PHP in Wordpress

Post by NickinChicago »

I'm hoping someone can help me with this as I am sure it is easy and I just don't know what I am doing. I am using the simplepress plug-in for wordpress and am trying to ad adsense ads to any forums posts. I read the instructions on their site but am having problems still. When I save the php file and upload it to the hooks folder within the plug-ins folder it doesn't work. Instead of placing the ad in the post it places it in the header for every page of the site. Below is what displays in the header.

{function sf_hook_first_post($forumid, $topicid) $x = ' '; return $x; }
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/61/6669961/html/wp-content/plugins/simple-forum/forum/hooks/sf-hook-template.php:5) in /home/content/61/6669961/html/wp-content/plugins/wp-responder-email-autoresponder-and-newsletter-plugin/wpresponder.php on line 269

And this is the code in the file I am uploading.

{function sf_hook_first_post($forumid, $topicid)

$x = '<script type="text/javascript"><!--
google_ad_client = "pub-XXXXXXXXXXXX";
/* 234x60, created 9/8/10 */
google_ad_slot = "1443406738";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>';

return $x;
}
amargharat
Forum Commoner
Posts: 82
Joined: Wed Sep 16, 2009 2:43 am
Location: Mumbai, India
Contact:

Re: Help with PHP in Wordpress

Post by amargharat »

Check whether file has any space or line above or below function start or end.

It is because of the blank space before the header
Post Reply