The Objective of this hack to display Google Ads (or) some copyright notice at the bottom of every page of wordpress.
Before Jumping into the Hack, There is two other way to acheive the same.
- Edit the footer.php file in the wordpress theme folder (wp-contents/themes/) to add the Google-ad code.
(The disadvantage of this method is that, when you change the theme, you need again edit the footer.php file in the new theme) - Using a wordpress plugin post footer. By this plugin, one can add any text/html to the footer of the posts.
(Disadvantage : Plugin Advertisement / unwanted upgrades)
Now, the Hack Script is as follows
Place your google code at the html commented section of code below
<?
function sp_add_page_footer() {
?>
<!--You're text or google Ad goes here-->
<?
}
add_action('get_footer', 'sp_add_page_footer', 10);
?>
That’s it.. copy the code, place it in my-hacks.php which is created at the wordpress root folder. Voila!! The first wordpress hack
No related posts.



