How to get full slug, including all parent pages

This would replace domain.com/top_page/sub_page/sub_sub_page with /top_page/sub_page/sub_sub_page

$path = str_replace(home_url(),'',get_permalink());

Leave a Comment