Erasersharp Erasersharp - 3 months ago 7
PHP Question

Get the parent page title name from a specific page ID number

I have a page ID number stored in a variable. However I'm trying to access that specific page ID numbers parent page title.

Could someone lead me in the right direction.

Answer

Please try to use the following code:

get_the_title(wp_get_post_parent_id($your_post_ID));
Comments