I want to create a basic breadcrumb menu on my site and i'm using this code
<?php $parents = $page->parents(); ?>
<?php foreach( $parents as $item): ?>
<span><a href='<?php echo $item->url; ?>'><?php echo $item->title; ?></a></span>
<?php endforeach; ?>
<span><?php echo $page->title; ?></span>
When i print_r $page->parents() it has the correct count and urls. But when i go to foreach it misses out a step.
for example if i was on the curriculum page it should say: home > about us > curriculum
but it just echo's out: home > curriculum
Am i doing the foreach wrong? i followed the example code Ryan posted for making a breadcrumb menu.