(a)  The person or persons receiving the greatest number of votes at the primary or special primary as a candidate of a party for an office shall be the candidate of the party at the following general or special general election but not more candidates for a party than there are offices to be elected; provided that any candidate for any county office who is the sole candidate for that office at the primary or special primary election, or who would not be opposed in the general or special general election by any candidate running on any other ticket, nonpartisan or otherwise, and who is nominated at the primary or special primary election shall, after the primary or special primary election, be declared to be duly and legally elected to the office for which the person was a candidate regardless of the number of votes received by that candidate.

     (b)  Any nonpartisan candidate receiving at least ten per cent of the total votes cast for the office for which the person is a candidate at the primary or special primary, or a vote equal to the lowest vote received by the partisan candidate who was nominated in the primary or special primary, shall also be a candidate at the following election; provided that when more nonpartisan candidates qualify for nomination than there are offices to be voted for at the general or special general election, there shall be certified as candidates for the following election those receiving the highest number of votes, but not more candidates than are to be elected.