Shift register 74HC164 not working
Looks like you forgot to set the pins as outputs.  You'll need to write to DDRB and DDRD at the start of your main method.  The shift register input pins are probably picking up stray electric fields right now as they are very high impedance.  Now, it's possible there's something else going on too, but getting the pins turned on is the first step.