2 added 8 characters in body
source | link

you should do something like this

//For update a page when use costum template
$post = get_the_ID();

 $my_post = array(
  'ID'           => $post,
  'comment_status' => 'open' // closed
);

// Update the post into the database
wp_update_post( $my_post );

);

// Update the post into the database wp_update_post( $my_post );

you should do something like this

//For update a page when use costum template
$post = get_the_ID();

 $my_post = array(
  'ID'           => $post,
  'comment_status' => 'open' // closed

);

// Update the post into the database wp_update_post( $my_post );

you should do something like this

//For update a page when use costum template
$post = get_the_ID();

 $my_post = array(
  'ID'           => $post,
  'comment_status' => 'open' // closed
);

// Update the post into the database
wp_update_post( $my_post );
1
source | link

you should do something like this

//For update a page when use costum template
$post = get_the_ID();

 $my_post = array(
  'ID'           => $post,
  'comment_status' => 'open' // closed

);

// Update the post into the database wp_update_post( $my_post );