  The leading finite-volume and thermal effects, arising in numerical lattice
QCD calculations of $a^{\text{HVP,LO}}_\mu \equiv (g-2)^{\text{HVP,LO}}_\mu/2$,
are determined to all orders with respect to the interactions of a generic,
relativistic effective field theory of pions. In contrast to earlier work based
in the finite-volume Hamiltonian, the results presented here are derived by
formally summing all Feynman diagrams contributing to the Euclidean
electromagnetic-current two-point function, with any number of internal pion
loops and interaction vertices. As was already found in our previous
publication, the leading finite-volume corrections to $a^{\text{HVP,LO}}_\mu$
scale as $\exp[- m L]$ where $m$ is the pion mass and $L$ is the length of the
three periodic spatial directions. In this work we additionally control the two
sub-leading exponentials, scaling as $\exp[- \sqrt{2} m L]$ and $\exp[-
\sqrt{3} m L]$. As with the leading term, the coefficient of these is given by
the forward Compton amplitude of the pion, meaning that all details of the
effective theory drop out of the final result. Thermal effects are additionally
considered, and found to be sub-percent-level for typical lattice calculations.
All finite-volume corrections are presented both for $a^{\text{HVP,LO}}_\mu$
and for each time slice of the two-point function, with the latter expected to
be particularly useful in correcting small to intermediate current separations,
for which the series of exponentials exhibits good convergence.
