In Newtonian gravity the potential energy is given as
$U=-GMm/r$
for objects near the earth the acceleration of gravity g can be considered to be approximately constant and the expression for potential energy relative to the Earth's surface becomes
$U=mgh$
where h is the height above the surface and g is the surface value of the acceleration of gravity.
So one has to be clear of the frame of reference, to which potential energy is defined.
You ask:
I think that potential energy is caused by gravity because of its position and distance from the surface of the earth, so will you have no potential energy if you were at the core?
This is true when r, the radius from the center of mass , is smaller than R the radius of earth. It is not true when r is smaller than R.
There exists the shell theorem, which proves that there is no gravitational potential within a mass shell:

So it is only the mass of the sphere smaller than r that affects the acceleration: and the g in $U=mgh$ is effectively variable, becoming zero at the center.
Consider a tube going through a diameter of the earth and a person from the surface falls. What is the potential energy as a function of r? Lets see the acceleration on the falling mass:
Your initial acceleration would be the surface acceleration of gravity

but the acceleration would be progressively smaller as you approached the center. Your weight would be zero as you flew through the center of the Earth.

$g_eff$ is zero at the centero of the earth and thus the potential energy at the center is zero,
As the mass passes through the center there is zero mass there to have an effective attraction that will create potential energy, so at the center the potential energy is zero. It has become kinetic energy that will bring the particle to the surface on the other side, in the oscillation calculated in the link given.