Skip to content
Snippets Groups Projects
Verified Commit 61109e89 authored by David Beniamine's avatar David Beniamine
Browse files

Wip better nav

parent 7f582b66
No related branches found
No related tags found
No related merge requests found
...@@ -20,9 +20,7 @@ ...@@ -20,9 +20,7 @@
<?php echo total_comments();?> <?php echo pluralise(total_comments(), "commentaire", "s") ?>.<?php endif; ?> <?php echo article_custom_field('attribution'); ?></p> <?php echo total_comments();?> <?php echo pluralise(total_comments(), "commentaire", "s") ?>.<?php endif; ?> <?php echo article_custom_field('attribution'); ?></p>
<ul style="list-style:none;box-sizing:border-box"> <ul style="list-style:none;box-sizing:border-box">
<li style="float:left;padding:15px"><a href="<?php echo article_previous_url()?>">Article précédent</a></li> <li style="float:left;padding:15px"><a href="<?php echo article_previous_url()?>">Article précédent</a></li>
<!--
<li style="float:left;padding:15px"><a href="<?php echo article_category_url()?>">Tous les articles de la catégorie <?php echo article_category();?></a></li> <li style="float:left;padding:15px"><a href="<?php echo article_category_url()?>">Tous les articles de la catégorie <?php echo article_category();?></a></li>
-->
<li style="float:left;padding:15px"><a href="<?php echo article_next_url()?>">Article suivant</a></li> <li style="float:left;padding:15px"><a href="<?php echo article_next_url()?>">Article suivant</a></li>
</ul> </ul>
</section> </section>
......
...@@ -18,11 +18,9 @@ h2{ ...@@ -18,11 +18,9 @@ h2{
} }
#top { #top {
overflow: hidden;
padding: 20px 35px; padding: 20px 35px;
margin: 20px; margin: 20px;
background: #fff; background: #fff;
border-bottom: 1px solid rgba(22,54,36,.1);
} }
#top a { #top a {
float: left; float: left;
...@@ -76,12 +74,13 @@ h2{ ...@@ -76,12 +74,13 @@ h2{
} }
.items > li { .items > li {
padding: 70px 0 60px; padding: 70px 0 60px;
border-bottom: 1px solid;
color: #97c9ae; #color: #97c9ae;
background: #3c4552; #background: #3c4552;
} }
.posts .items > li:first-child { .posts .items > li:first-child {
background: #fff !important; #background: #fff !important;
padding: 110px 0; padding: 110px 0;
} }
.items li h1 a, .posts .items > li:first-child h2 a { .items li h1 a, .posts .items > li:first-child h2 a {
...@@ -151,6 +150,7 @@ h2{ ...@@ -151,6 +150,7 @@ h2{
*/ */
.content { .content {
padding: 10px 0px; padding: 10px 0px;
border-top: 1px solid rgba(22,54,36,.1);
} }
.content ul, .content ol, .items li ul { .content ul, .content ol, .items li ul {
padding: 20px 30px; padding: 20px 30px;
......
...@@ -136,11 +136,26 @@ function build_menu($parent, $tree){ ...@@ -136,11 +136,26 @@ function build_menu($parent, $tree){
build_menu($item->id, $tree); build_menu($item->id, $tree);
echo '</ul>'; echo '</ul>';
echo '</li>'; echo '</li>';
}else{
if(menu_name($item) == "Blog"){
echo '<li class="dropdown '.$class.'"><a class="dropdown-toggle" data-toggle="dropdown" href="#">'.menu_name($item).'<span class="caret"></span></a>';
echo '<ul class="dropdown-menu">';
echo '<li><a href="'.menu_url($item).'" title="Tous les articles">';
echo 'Tous les articles </a></li>';
while(categories()){
if(category_count() > 0 ){
echo '<li><a href="'.category_url().'" title="'.category_title().'">';
echo category_title().' </a></li>';
}
}
echo '</ul>';
echo '</li>';
}else{ }else{
print_item($item, $class); print_item($item, $class);
} }
} }
} }
}
function menu_tree(){ function menu_tree(){
$tree=array(); $tree=array();
......
...@@ -15,41 +15,36 @@ ...@@ -15,41 +15,36 @@
echo "<h1 style='text-align:center'>$title</h1>\n"; echo "<h1 style='text-align:center'>$title</h1>\n";
?> ?>
<?php if(has_posts()): ?> <?php if(has_posts()): ?>
<ul class="items">
<?php posts(); ?> <?php posts(); ?>
<li>
<h2> Dernier article </h2> <h2> Dernier article </h2>
<?php include("single_article.php"); ?> <?php include("single_article.php"); ?>
</li>
<!-- <!--
<?php if (!preg_match('/category.*/',current_url())): ?> <?php if (!preg_match('/category.*/',current_url())): ?>
<li id="<?php echo current_url();?>" style="background:none">
<h2> Catégories d'articles </h2> <h2> Catégories d'articles </h2>
<ul style="list-style:none">
<?php $i = 0; while(categories()): ?> <?php $i = 0; while(categories()): ?>
<?php $bg = sprintf('background: hsl(131, 6%%, %d%%);', round(50-(($i / total_categories()) * 20))); ?>
<?php if(category_count() > 0 ):?> <?php if(category_count() > 0 ):?>
<?php ++$i; ?> <li >
<li style="<?php echo $bg; ?>">
<?php include("single_category.php"); ?> <?php include("single_category.php"); ?>
</li> </li>
<?php endif; ?> <?php endif; ?>
<?php endwhile; ?> <?php endwhile; ?>
</li> </ul>
<?php endif; ?> <?php endif; ?>
--> -->
<?php if(total_posts() > 1 || $title=="Blog"):?> <?php if(total_posts() > 1 || $title=="Blog"):?>
<li style="background:none">
<h2> Articles précédents </h2> <h2> Articles précédents </h2>
<ul class="items">
<?php $i = 0; while(posts()): ?> <?php $i = 0; while(posts()): ?>
<?php $bg = sprintf('background: hsl(131, 6%%, %d%%);', round(50-((++$i / posts_per_page()) * 20))); ?> <li >
<li style="<?php echo $bg; ?>">
<?php include("single_article.php"); ?> <?php include("single_article.php"); ?>
</li> </li>
<?php endwhile; ?> <?php endwhile; ?>
</li> </li>
<?php endif?>
</ul> </ul>
<?php endif?>
<?php if(has_pagination()): ?> <?php if(has_pagination()): ?>
<nav class="pagination"> <nav class="pagination">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment