2 edited body
source | link

Something like this should work from your functions file as long as you use the coorectcorrect conditional tag for your CPT archive:

function exclude_single_post_cpt($query) {
  if (is_post_type_archive('event') && $query->is_main_query() && !is_admin() ) {
    $query->set('post__not_in', array(1646));
  }
}

add_action('pre_get_posts', 'exclude_single_post_cpt');

Something like this should work from your functions file as long as you use the coorect conditional tag for your CPT archive:

function exclude_single_post_cpt($query) {
  if (is_post_type_archive('event') && $query->is_main_query() && !is_admin() ) {
    $query->set('post__not_in', array(1646));
  }
}

add_action('pre_get_posts', 'exclude_single_post_cpt');

Something like this should work from your functions file as long as you use the correct conditional tag for your CPT archive:

function exclude_single_post_cpt($query) {
  if (is_post_type_archive('event') && $query->is_main_query() && !is_admin() ) {
    $query->set('post__not_in', array(1646));
  }
}

add_action('pre_get_posts', 'exclude_single_post_cpt');
1
source | link

Something like this should work from your functions file as long as you use the coorect conditional tag for your CPT archive:

function exclude_single_post_cpt($query) {
  if (is_post_type_archive('event') && $query->is_main_query() && !is_admin() ) {
    $query->set('post__not_in', array(1646));
  }
}

add_action('pre_get_posts', 'exclude_single_post_cpt');