moving yoast breadcrumb support into actions

This commit is contained in:
Ben Word
2011-05-30 09:40:02 -06:00
parent 91d81ddb6e
commit 1aa3fa0f33
2 changed files with 11 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ add_action('roots_header_before', 'roots_1140_header_before');
add_action('roots_header_after', 'roots_1140_header_after');
add_action('roots_footer_before', 'roots_1140_footer_before');
add_action('roots_footer_after', 'roots_1140_footer_after');
add_action('roots_post_inside_before', 'roots_page_breadcrumb');
function roots_1140_head() {
$options = roots_get_theme_options();
@@ -49,4 +50,14 @@ function roots_1140_footer_after() {
}
}
function roots_page_breadcrumb() {
global $post;
if (function_exists('yoast_breadcrumb')) {
if (is_page() && $post->post_parent) {
yoast_breadcrumb('<p id="breadcrumbs">','</p>');
}
}
wp_reset_postdata();
}
?>