WordPress hacked – through get_footer funtction
Recently I have noticed that my wordpress blog was abused by spam links showing at the bottom of the page and beneath the sidebar.
After couple of tests I came to realise that the spam links where somehow embedded in the get_footer() function, which is called at the last line of your Main Index Template, Page Template and Single Post template. The function itself is located in wp-includes/general-template.php.
However the easiest way to get rid of the hacked get_footer is update your wordpress to the latest version or reinstall your current version. After completing this step it is strongly recommended that you change your passwords for accessing wp-admin and ftp.