Hello,
Provide us with link to your site and temporary WP Dashboard access to your site to check the issue in more detail and help you with the custom code.
Regards