Compare commits
3 commits
7690aa2bd3
...
8b9b2afe94
Author | SHA1 | Date | |
---|---|---|---|
|
8b9b2afe94 | ||
|
1878ab7866 | ||
|
1e27dd42f5 |
9 changed files with 75 additions and 4 deletions
23
category-blog.php
Normal file
23
category-blog.php
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?php get_header(); ?> <!-- ouvrir header,php -->
|
||||
<main class="col-md-8">
|
||||
<?php
|
||||
$category = get_category( get_query_var( 'cat' ) );
|
||||
$cat_id = $category->cat_ID; ?>
|
||||
|
||||
<?php include(TEMPLATEPATH . '/components/posts-list.php'); ?>
|
||||
|
||||
</main>
|
||||
|
||||
<!-- Sidebar custom pour contenir la description -->
|
||||
<aside class="sidebar">
|
||||
<div class="card card-info">
|
||||
<div class="card-header"><i class="fa fa-folder-open"></i> <?php echo single_cat_title(); ?></div>
|
||||
<div class="card-body">
|
||||
<?php the_archive_description() ?>
|
||||
<p><? echo '<a href="' . get_category_link( $cat_id ) . 'feed/" title="RSS de la categorie" />Flux RSS</a> de la categorie'; ?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include(TEMPLATEPATH . '/components/sidebar-content.php'); ?>
|
||||
</aside>
|
||||
<?php get_footer(); ?>
|
|
@ -4,7 +4,7 @@
|
|||
$category = get_category( get_query_var( 'cat' ) );
|
||||
$cat_id = $category->cat_ID; ?>
|
||||
|
||||
<?php include(TEMPLATEPATH . '/components/posts-list.php'); ?>
|
||||
<?php include(TEMPLATEPATH . '/components/preview-list.php'); ?>
|
||||
|
||||
</main>
|
||||
|
||||
|
|
|
@ -1,4 +1,15 @@
|
|||
<div class="navbar-area">
|
||||
<?php
|
||||
$categories = get_categories( array(
|
||||
'orderby' => 'name',
|
||||
'order' => 'ASC'
|
||||
) );
|
||||
|
||||
foreach( $categories as $category ) {
|
||||
if ($category->slug == "blog") {
|
||||
echo '<a class="btn btn-navbar" href="' . get_category_link($category->term_id) . '">' . $category->name . '</a>';
|
||||
}
|
||||
}?>
|
||||
<!-- <a href="/blog.html" class="btn btn-navbar">Blog</a> -->
|
||||
<!-- <a href="/crea.html" class="btn btn-navbar">Romans</a> -->
|
||||
<!-- <a href="/apropos.html" class="btn btn-navbar">A propos</a> -->
|
||||
|
|
27
components/preview-list.php
Normal file
27
components/preview-list.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php if(have_posts()) : ?>
|
||||
<div class="previews-section">
|
||||
<?php while(have_posts()) : the_post(); ?>
|
||||
<article class="card card-preview card-primary">
|
||||
<a href="<?php the_permalink(); ?>" class="preview-link">
|
||||
<div class="preview-item">
|
||||
<div class="preview-content"><?php the_excerpt(); ?></div>
|
||||
<div class="preview-overlay">
|
||||
<h1 class="card-header"><?php the_title(); ?></h1>
|
||||
<div class="preview-metadata">
|
||||
<div class="metadata-pills">
|
||||
<div><?php $category = get_the_category();
|
||||
echo"<span class='btn-small btn-info small-text'>" . $category[0]->cat_name . "</span>"; ?></div>
|
||||
<div><time><span class="btn-small btn-info small-text"><?php the_time('d/m/Y') ?></span></time></div>
|
||||
</div>
|
||||
<div class="comment-text"><?php comments_number('Pas de commentaire', 'Un commentaire', '% commentaires' );?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</article>
|
||||
<?php endwhile; ?>
|
||||
</div>
|
||||
<div class="navigation">
|
||||
<?php the_posts_pagination(); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
|
@ -8,7 +8,9 @@
|
|||
) );
|
||||
|
||||
foreach( $categories as $category ) {
|
||||
if ($category->slug != "blog") {
|
||||
echo '<a class="menu-element" href="' . get_category_link($category->term_id) . '">' . $category->name . '<span class="menu-label label-secondary">'. $category->count . '</span></a>';
|
||||
}
|
||||
}?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -244,6 +244,9 @@ code {
|
|||
margin-bottom: 3rem;
|
||||
}
|
||||
|
||||
.small-text {
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
|
||||
/* 2.6 - Special styling */
|
||||
|
|
|
@ -156,6 +156,7 @@ $preview-height: 8*$lineheight;
|
|||
justify-content:space-between;
|
||||
padding-left: $lineheight/2;
|
||||
padding-right: $lineheight/2;
|
||||
font-size:0.9em;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -497,6 +497,9 @@ code {
|
|||
margin: auto;
|
||||
margin-bottom: 3rem; }
|
||||
|
||||
.small-text {
|
||||
font-size: 0.9em; }
|
||||
|
||||
/* 2.6 - Special styling */
|
||||
mark {
|
||||
border-radius: 0.2em;
|
||||
|
@ -1841,7 +1844,8 @@ ul.breadcrumb, ol.breadcrumb, .breadcrumb {
|
|||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding-left: 0.75rem;
|
||||
padding-right: 0.75rem; }
|
||||
padding-right: 0.75rem;
|
||||
font-size: 0.9em; }
|
||||
|
||||
.card-preview.card-info .comment-text {
|
||||
position: relative;
|
||||
|
|
2
tag.php
2
tag.php
|
@ -3,7 +3,7 @@
|
|||
<?php $tag = get_category( get_query_var( 'tag' ) );
|
||||
$tag_id = $tag->ID;?>
|
||||
|
||||
<?php include(TEMPLATEPATH . '/components/posts-list.php'); ?>
|
||||
<?php include(TEMPLATEPATH . '/components/preview-list.php'); ?>
|
||||
</main>
|
||||
<!-- Sidebar custom pour contenir la description -->
|
||||
<aside class="sidebar">
|
||||
|
|
Reference in a new issue