Define custom twig page template for specific multiple node pages by nid - page--custom.html.twig I have a page from different content type and I want to define a custom twig page template to these pages by their nid. 

Eg. I have pages like node/2, node/4, node/20 and node/40 from the different content type and I want to apply page--custom.html.twig template only these specific pages by checking their ID. 

Anyone know how to do this?
You can write a hook_theme_suggestions_page_alter()

/**
 * Implements hook_theme_suggestions_page_alter().
 */
function YOUR_THEME_NAME_theme_suggestions_page_alter(array &amp;$suggestions, array $variables) {
  if ($node = \Drupal::routeMatch()-&gt;getParameter('node')) {
    if ($node-&gt;id() == 2 || $node-&gt;id() == 4 || $node-&gt;id() == 20 || $node-&gt;id() == 40) {
      $suggestions[] = 'page__custom';
    }
  }