I would like to get the page title of the top most parent page. For example..
Pets
\- Dogs
\– Basset Hound
\– Cocker Spaniel
\- Cats
If I am on the **Cocker Spaniel** page I want to be able to get the page title of **Pets.** My goal is to put this page title into a shortcode that I can use in Elementor.
Something like this
$parentid = wp_get_post_parent_id(get_the_ID())
echo get_the_title($patentid);