Grind half of the flour with the walnuts in a food processor to an almond flour–like consistency, about 2 minutes.
Cream the butter and sugar together with the paddle attachment on low speed for about 3 minutes. Add the nut-flour mixture all at once along with the rest of the flour. Mix on low speed until just until combined, about 2 minutes.