In Pennsylvania, you can file for child custody if you are a parent of the child, someone acting “in loco parentis” (or in place of a parent to a child), or a grandparent who is not “in loco parentis” (under certain circumstances).