Try to disable cache plugin you are using and check pages without the previous custom code. Maybe the problem is caused by a cache.
Regards