Bonjour!

Je souhaite ajouter une fonction de breadcrumb dans mon code php.
J'utilise la fonction suivante:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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>";
   };
}
 
?>
Comme vous remarquez le test sur if page se diffère à celui if single

Dans mon cas, j'ai besoin de traiter le test de single et puis récupérer la page précédente et récupérer son breadcrumb entant que page.
Pour mieux expliquer:
le breadcrumb de single est comme suit: Acceuil >> titre précedent:
Alors que je souhaite avoir Acceuil >> titre-page1 >> titre-page2 >> .. >> titre-page-précédente:

Y a-t-il quelqu'un qui peut me rediriger un peu?
Merci pour toute interaction!