How to add H1 to this code
-
I have a function that displays breadcrumb links for pages and the parents. The current page title is displayed as text while the parents are a link. I’d like to have the current page wrapped in H1 tags, is this possible with this code:
function get_breadcrumb() { global $post; $trail = ''; $page_title = get_the_title($post->ID); if($post->post_parent) { $parent_id = $post->post_parent; while ($parent_id) { $page = get_page($parent_id); $breadcrumbs[] = '<a href="' . get_permalink($page->ID) . '">' . get_the_title($page->ID) . '</a> » '; $parent_id = $page->post_parent; } $breadcrumbs = array_reverse($breadcrumbs); foreach($breadcrumbs as $crumb) $trail .= $crumb; } $trail .= $page_title; $trail .= ''; return $trail; }Or if easier can the current page title/breadcrumb be removed completely only leaving the parents in the list?
Thanks for any help.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘How to add H1 to this code’ is closed to new replies.