Only show content if current page is NOT one of 2 page templates [closed]

If you want don’t want to show content if the current template is template-custom.php or template-custom2.php you can use:

if (!is_page_template('template-custom.php') && !is_page_template('template-custom2.php')) {
    <!-- show some content when you AREN NOT in template-custom.php NOR template-custom2.php -->
}

or

if (is_page_template('template-custom.php') || is_page_template('template-custom2.php')) {
    <!-- show some content when you ARE in template-custom.php OR template-custom2.php -->
}