Zombies tend to follow instinct, but have been known to react to certain stimuli that do not involve food.
George Romero is responsible for the typical 'zombie rules', and his original trilogy set those rules. Zombies are slow and essentially mindless, they crave living flesh and prefer human, zombies are drawn to sounds and motion, zombies do not attack other zombies, zombie bites are fatal, and dead people rise as zombies (often changed to 'dead from zombie bites').
Even in Romero's original trilogy, he broke these rules whenever it was needed to make a better movie, as I've said before.
But there are some actions which are so automatic that they become instinctive. For instance, many people who drive the same route frequently don't need to focus on it. They'll frequently have their minds on other subjects, yet still drive safely and on the correct route. It's possible that different zombies retain different 'learned instincts'. Remember Bub from Day of the Dead? He was an outstanding example of a zombie retaining some learned instincts, even before the training he was given.
Further, in the 'Day by Day Armageddon' series the protagonist comes up with a theory of what he calls 'ten-percenters', noting that about 1 out of every 10 zombies seems slightly more capable than the rest. They retain some problem solving skills, can recognize patterns they've seen frequently, are better able to climb stairs or ladders, or something similar that sets them apart.
In a town that's been abandoned as long as Rick's home town, only the most capable zombies will still be present and successful in hunting. Thus, the ones we see that are most active are likely the highest-functioning.
Later in the series, when we're in areas with higher (or recently higher) populations, the most capable zombies just don't stand out as much (or got to the harder-to-reach, better defended 'food' first and have been head-shot already).