Whether "there" is an adverb has nothing to do with its antecedent. It doesn't matter much whether "there" refers to a definite or indefinite place. When the place is definite, it means something like "in that place". When indefinite, it means something like "in some place".
What's important here is that "there" doesn't just share its meaning with those prepositional phrases but also shares much of its behavior. Like a prepositional phrase, "there" can modify both nouns and verbs. Like a prepositional phrase, when it is directly modifying a noun it tends to follow that noun: Most dialects prefer "those hills there" to "them thar hills".
Traditional grammars label this word as an adverb. Modern grammars might label this word as an intransitive preposition. Whichever label is used, a switch between definite and indefinite referent has no impact on the grammatical word class in question. The word behaves much the same no matter which particular meaning it carries.