Hide a div from a particular page and single pages in WordPress

Just change this:

<?php if( is_page() ) { ?>

to:

<?php if( is_page() && !is_page(42) ) { ?>

You can also try to use is_home() and is_front_page(). These 2 will be even better, since they are more universal (not based on pageId). If you change the page that is your home/front page, this will still work.