Support Forum

Adding Adsense To Post

YS Yap Pau Seng
Yap Pau Seng
Member

Hi,

will anyone know on how to add adsense code in all posts (position to be located below every new topic or reply)

10 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

This thread might server as a useful introduction to this subject – there are many other threads as well…
https://simple-press.com/support-forum/sp5-coding-questions/adsense-code/

YS Yap Pau Seng
Yap Pau Seng
Member

im stuck..

can i do this way ?

under spTopicView.php >

sp_SectionEnd(”, ‘topicView’);

sp_SectionEnd(”, ‘body’);

paste my adsense code here.

YS Yap Pau Seng
Yap Pau Seng
Member

it gives me this error Parse error: syntax error, unexpected ‘<‘ in /problem-with-post-edit-buttonome/mjhub/public_html/sportsforlife.sg/wp-content/sp-resources/forum-themes/default/templates/spTopicView.php on line 197

YS Yellow Swordfish
Yellow Swordfish
Member

That means your php is badly formed.
Why don’t you paste your code here and we can take a look. Best to put it in a code block else some can get stripped.

YS Yap Pau Seng
Yap Pau Seng
Member

Under this Section

under spTopicView.php >

                # Start the ‘pagelinks’ section
                # ———————————————————————-
                 }
                 }

                 }
                 }

                # Start the ‘editor’ section
                # ———————————————————————-
                }
                }
        sp_SectionEnd(”, ‘topicView’);

<script type=”text/javascript”><!– google Ads
}
}
}
</script>

    sp_SectionEnd(”, ‘body’);
     }
     }
     }
    sp_SectionEnd(”, ‘foot’);
?>

YS Yellow Swordfish
Yellow Swordfish
Member

As I said you wil need to put this into a code block.

Paste the code. Carefully select it (JUST the code – no more). Click on the toolbar code button – far right. Select php.

MP Mr Papa
Mr Papa
Member

as Andy says, would make it alot easier if you pasted as code…

but looks like you entered html code in a php code segment….  so before you script stuff, enter

?>

and then after it, enter

<?php