1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
| <?php
function the_breadcrumb() {
$current = $post->ID;
$parent = $post->post_parent;
$grandparent_get = get_post($parent);
$grandparent = $grandparent_get->post_parent;
if (!is_home()) {
echo '<a href="';
echo get_option('home');
echo '">';
echo 'Accueil';
echo "</a> » ";
if (is_category() || is_archive()) {
the_category('title_li=');
}//fin test categorie ||archive
elseif (is_page() || is_single()) {
if (is_single()) {
$monUrl = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$precUrl= $_SERVER['HTTP_REFERER'];
$include = implode( file($_SERVER['HTTP_REFERER']),"");
if(eregi("<title>(.*)</title>",$include,$title))
{ echo $title[1];}
} //fin test is single
elseif (is_page()){
if ($root_parent = get_the_title($grandparent) !== $root_parent = get_the_title($current)) {
echo "<a href='";
echo get_permalink($grandparent_get->post_parent);
echo "'>";
echo get_the_title($grandparent);
echo "</a>";
echo " » ";
}
echo '';
echo the_title();
echo '';
}//fin is page
}
} else if ( is_home() ) {
echo '<a href="';
echo get_option('home');
echo '">';
echo 'Accueil';
echo "</a>";
};
}
?> |
Partager