<?php
/**
 * The default template for displaying content
 *
 * Used for both single and index/archive/search.
 *
 * @package WordPress
 * @subpackage Twenty_Thirteen
 * @since Twenty Thirteen 1.0
 */
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
if (is_search()) {
?>
<div class="contenu fil">
 <?php // Breadcrumb navigation

        echo '<ul>';
        echo '<li><a title="Accueil" rel="nofollow" href="/">Accueil</a></li>';

        if ($post->post_type == 'page') {

            $ancestors = get_post_ancestors($post);
            
            if ($ancestors) {
                $ancestors = array_reverse($ancestors);
                foreach ($ancestors as $crumb)
                    echo '<li>&nbsp;/&nbsp;<a href="'.get_permalink($crumb).'">'.get_the_title($crumb).'</a></li>';
            }
        }
        
        if ($post->post_type == 'question')
            echo '<li>&nbsp;/&nbsp;<a href="'.get_permalink(301).'">'.get_the_title(301).'</a></li>';

        // if (is_single()) {
            // $category = get_the_category();
            // echo '<li>&nbsp;<a href="'.get_category_link($category[0]->cat_ID).'">'.$category[0]->cat_name.'</a> &nbsp;/ </li>';
        // }

        // if (is_category()) {
            // $category = get_the_category();
            // echo '<li>&nbsp; '. $category[0]->cat_name. '</li>';
        // }

        // Current page
        // if (is_page() || is_single()) {
            $category = get_the_category();
            if ($post->post_type == 'post' && $category[0]->slug == 'actualite')
                echo '<li>&nbsp;/&nbsp;<a href="'.get_permalink(354).'">'.get_the_title(354).'</a></li>';
            // echo '<li>&nbsp;'.get_the_title().'</li>';
        // }
        echo '</ul>';
?>
<div style="clear:both"></div>
</div>
<?php
}
?>
    <?php if ( is_single() ) : ?>
    <h1 class="entry-title"><?php the_title(); ?></h1>
    <?php else : ?>
    <h2 class="entry-title">
        <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
    </h2>
    <?php endif; // is_single() ?>

    <?php if ( has_post_thumbnail() && ! post_password_required() && !is_search()) : ?>
    <div class="entry-thumbnail alignleft">
        <?php the_post_thumbnail(); ?>
    </div>
    <?php endif; ?>
    <?php if ( is_search() ) : // Only display Excerpts for Search ?>
    <div class="entry-summary">
        <?php
        add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
        the_excerpt();
        ?>
    </div><!-- .entry-summary -->
    <?php else : ?>
    <div class="entry-content">
        <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?>
        <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?>
    </div><!-- .entry-content -->
    <?php endif; ?>

    <footer class="entry-meta">
        <?php edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); ?>
    </footer><!-- .entry-meta -->
</article><!-- #post -->
