@rashed You can put this code in your functions.php file, which acts like a plugin that is automatically loaded for the current WordPress theme (more info).
If this problem is happening for you, though, I would definitely recommend starting a support ticket with ACF, since this particular forum post is almost five years old and might be a completely different issue. 🙂
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users