I'm using ACF plugin and I want to pull a custom field from the previous page.
I have a WP site that has a homepage and then 20 sub pages. Each sub page is for a specific city and each city has its own contact phone number. Then interested viewers will go to an apply page.
So the flow will hopefully be HOME » Your city page » Apply page. Rather than make an Apply page for every city, I want to pull the custom field from the city page the viewer visited before arriving at the apply page.
I found this info: Get previously visited page ID
But it's a bit advanced for me. Anyone willing to dumb it down and show me what this might look like in practice?
The ACF plugin has the ability to pull a custom field from another page using IDs:
<p><?php the_field('city_phone', 123); ?></p>
That would return the custom field city_phone from post 123. How would I get the previous pages ID into 123?