<?php /* Template Name: page-about */ ?>
<?php get_header(); ?> <!-- ouvrir header,php -->
<main>
  <?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>

  <article class="article-content container-article" id="post-<?php the_ID(); ?>">
  <h1 class="page-title"><?php the_title(); ?></h1>

    <div class="article-body">
      <?php the_content(); ?>
    </div>
  </article>

  <?php endwhile; ?>
  <?php endif; ?>
</main>
<aside class="sidebar">
  <div class="card card-info">
    <?php $desc = explode(";", get_the_author_meta( 'infodata' )) ?>
    <div class="card-header"><i class="fa fa-info" aria-hidden="true"></i> <?php
      if (!empty($desc[1])) {
        echo $desc[1];
      } else {
        the_author();
      }
    ?></div>
    <p class="mwarea"><?php echo get_avatar( get_the_author_meta('user_email'), $size = '500'); ?></p>
    <table style="width:100%" class="table-primary">
        <tr>
          <th>Pseudo</th>
          <td><?php the_author() ?></td>
        </tr>
        <?php $user_description = $desc[0];
        $array_tr = explode ( ",", $user_description);
        foreach ($array_tr as $tr) {
          echo "<tr>";
          $array_td = explode(':', $tr);
          echo "<th>" . $array_td[0] . "</th>";
          echo "<td>" . $array_td[1] . "</td>";
          echo "</tr>";
        }
        ?>
      </table>
  </div>

  <?php include(TEMPLATEPATH . '/components/sidebar-content.php'); ?>
</aside>
<?php get_footer(); ?>
