How to add custom PHP code in post header?

Please try like

if ( is_front_page() || is_home() ) {
    //IF HOME PAGE
}

if ( is_singular('YOUR-CUSTOM-POST-TYPE-HERE') ) {
  // FOR SINGLE PAGE STUFF
}

Please make sure you have to replace YOUR-CUSTOM-POST-TYPE-HERE with your Custom post type.

Please let me know if any query.

Thanks!

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)