So let's say that a 3rd party presidential candidate causes nobody to receive a majority of electoral votes. The president would then be selected by the house, according to law. But the same third party won a sizable number of house seats, preventing the house from selecting a president. Same goes for the senate and selecting the vice president. This same 3-way split also causes the house to be unable to elect a speaker and the senate is unable to elect a president pro tempore. January 20th comes, and nobody is lined up to be president (there would obviously be no cabinet members). Who becomes president in this situation?
The secretary of state from the prior administration becomes Acting President.
Not necessarily; if the outgoing Secretary of State tenders their resignation prior to noon on January 20th (or sets it to take effect at precisely that moment), then it'd actually be the Acting Secretary of State (most likely one of the outgoing Deputy Secretaries of State or the outgoing Under Secretary of State for Political Affairs), assuming that person's prior appointment required Senate confirmation. If not, then we'd continue going down the line of succession (Treasury, Defense, Justice, etc.) until the highest-ranked Acting Secretary that was confirmed by the Senate for their post is found.