posts_per_page override by default settings

Regarding my comment to Steve’s answer, see also Override the default number of posts to show for a single loop? The “method” version of Steve’s answer would be:

function limit_posts_per_archive_page( $query ) {
  if ( $query->is_post_type_archive( 'zitate-sprueche' ) || $query->is_tax('zitate-kats') || $query->is_post_type_archive('daten') || $query->is_tax('daten-kats')) {
    $limit = 27;
  } else 
    $limit = get_option('posts_per_page');
  }
  $query->set( 'posts_per_archive_page', $limit );
}
add_action( 'pre_get_posts', 'limit_posts_per_archive_page' );

Similar code works for me.

tech