page.php 2.16 KB
Newer Older
agnez's avatar
agnez committed
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 50 51 52 53 54
<?php
/**
 * The template for displaying all pages.
 *
 * This is the template that displays all pages by default.
 * Please note that this is the WordPress construct of pages
 * and that other 'pages' on your WordPress site will use a
 * different template.
 *
 * @package multipurpose blog
 */

get_header(); ?>

<?php do_action( 'multipurpose_blog_header_page' ); ?>

<div id="content-blog" class="container">
    <div class="middle-align">
        <?php while ( have_posts() ) : the_post(); ?>
            <h1><?php the_title();?></h1><?php 
            if(has_post_thumbnail()) { ?>
                <div class="feature-box"><?php
                    $thumb_img = get_post_meta( get_post_thumbnail_id() );?>
                    <img src="<?php the_post_thumbnail_url('full'); ?>" width="100%" alt="<?php echo $thumb_img['_wp_attachment_image_alt']['0'];?>">
                </div><?php
                $img_legende = get_post(get_post_thumbnail_id())->post_excerpt;
                if(!empty($img_legende)){
                    echo '<div class="legende">' . $img_legende . '</div>';
                }
            }
            the_content();

            wp_link_pages( array(
                'before'      => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'multipurpose-blog' ) . '</span>',
                'after'       => '</div>',
                'link_before' => '<span>',
                'link_after'  => '</span>',
                'pagelink'    => '<span class="screen-reader-text">' . __( 'Page', 'multipurpose-blog' ) . ' </span>%',
                'separator'   => '<span class="screen-reader-text">, </span>',
            ) );

            //If comments are open or we have at least one comment, load up the comment template
                if ( comments_open() || '0' != get_comments_number() )
                    comments_template();
            ?>
        <?php endwhile; // end of the loop. ?> 
        <div class="clear"></div><?php
        if( is_page( 'espace-membres' )) {dynamic_sidebar('widget-em');} ?>     
    </div>
</div>

<?php do_action( 'multipurpose_blog_footer_page' ); ?>

<?php get_footer(); ?>