Forums
(@afonsojr)
15 years, 3 months ago
omg its works perfect! thanks very much!
15 years, 7 months ago
$parent = array_reverse(get_post_ancestors($post->ID)); $first_parent = get_page($parent[0]); echo $first_parent->post_name;
With it will always take the first parent. I hope being helpfull.