This question already has an answer here:
I have a client with his wordpress site hacked. The hackers added new folder and files and changed the index.php. I would like to know if when this happens, Could the hacker add also malicious code inside the pages, posts, comments or even images? I suppose the hackers inject the code in common wordpress files like index.php or footer.php , something that is always displayed. Am I right?