diff --git a/posts.php b/posts.php index b216c03ec5f0670492b319813aefc6f6db25bc8a..414ed21458403568f688432d15f442e5afcf760f 100644 --- a/posts.php +++ b/posts.php @@ -4,18 +4,29 @@ <?php if(has_posts()): ?> <ul class="items"> - <?php posts(); ?> - <li> - <h1> Dernier article </h1> - <?php include("single_article.php"); ?> - </li> - <h1> Articles précédents </h1> - <?php $i = 0; while(posts()): ?> - <?php $bg = sprintf('background: hsl(132, 22%%, %d%%);', round(((++$i / posts_per_page()) * 20) + 20)); ?> - <li style="<?php echo $bg; ?>"> - <?php include("single_article.php"); ?> - </li> - <?php endwhile; ?> + <?php posts(); ?> + <li> + <h1> Dernier article </h1> + <?php include("single_article.php"); ?> + </li> + <li style="background:none"> + <h1> Catégories d'articles </h1> + <?php $i = 0; while(categories()): ?> + <?php $bg = sprintf('background: hsl(131, 6%%, %d%%);', round(50-((++$i / posts_per_page()) * 20))); ?> + <li style="<?php echo $bg; ?>"> + <?php include("single_category.php"); ?> + </li> + </li> + <?php endwhile; ?> + <li style="background:none"> + <h1> Articles précédents </h1> + <?php $i = 0; while(posts()): ?> + <?php $bg = sprintf('background: hsl(131, 6%%, %d%%);', round(50-((++$i / posts_per_page()) * 20))); ?> + <li style="<?php echo $bg; ?>"> + <?php include("single_article.php"); ?> + </li> + </li> + <?php endwhile; ?> </ul> <?php if(has_pagination()): ?> diff --git a/single_category.php b/single_category.php new file mode 100644 index 0000000000000000000000000000000000000000..3d39ad52f9a65ab9b72e812d946b4f58a28b455b --- /dev/null +++ b/single_category.php @@ -0,0 +1,10 @@ +<article class="wrap"> + <div class="col-md-6 col-sd-12"> + <h2 style="padding:0px"> + <a href="<?php echo category_url(); ?>" title="<?php echo category_title(); ?>"><?php echo category_title(); ?></a> + </h2> + </div> + <div class="contents"> + <?php echo category_description(); ?> + </div> +</article>