Skip to content

Commit

Permalink
moving yoast breadcrumb support into actions
Browse files Browse the repository at this point in the history
  • Loading branch information
retlehs committed May 30, 2011
1 parent 91d81dd commit 1aa3fa0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 11 additions & 0 deletions inc/roots-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
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();
Expand Down Expand Up @@ -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();
}

?>
1 change: 0 additions & 1 deletion loop-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<?php while (have_posts()) : the_post(); ?>
<?php roots_post_before(); ?>
<?php roots_post_inside_before(); ?>
<?php if (function_exists('yoast_breadcrumb')) { if (is_page() && $post->post_parent) { yoast_breadcrumb('<p id="breadcrumbs">','</p>'); } } ?>
<h1><?php the_title(); ?></h1>
<?php the_content(); ?>
<?php wp_link_pages(array('before' => '<nav id="page-nav"><p>' . __('Pages:', 'roots'), 'after' => '</p></nav>' )); ?>
Expand Down

0 comments on commit 1aa3fa0

Please sign in to comment.