The poor harvest was due to the prolonged drought.

Literal

Poor-harvest [topic-は] drought-continuity [because of-のため] was.

不作 = 'poor harvest / crop failure.' 日照り続き = 'continued drought.' のためだった marks the cause in a was-because construction.