Quote Originally Posted by Marc J View Post
Most likely a compromised plugin, theme or core wordpress vulnerability that wasn't patched (you do keep WP and all your plugins up-to-date, right?).

Check your plugins, your .htaccess file, index.php, theme's files (esp. header and footer files), uploads folder, wp-config.php file. If you don't know what you're looking for that might be tricky (it won't look like the code above, it'll most likely be obfuscated javascript that injects the above into the page, so it'll look like a lot of unreadable code).

If you have a known good backup that might be your best approach, then bring everything up-to-date, and change your passwords.
Download Wordfence plugin, it will fix all your issues for you.