feat: simplification breadcrumb

This commit is contained in:
Kazhnuz 2022-11-23 19:40:47 +01:00
parent 02887963f9
commit 549581e736
9 changed files with 51 additions and 77 deletions

View file

@ -1,13 +1,6 @@
<?php get_header(); ?> <!-- ouvrir header,php -->
<main>
<div class="flex-that">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<?php echo site_url(); ?>">kazhnuz.space</a></li><li class="breadcrumb-item" aria-current="page"><span class="active"><i class="fa fa-calendar"></i> <?php echo get_the_archive_title(); ?></span></li>
</ol>
</nav>
</div>
<?php kspace_cat_breadcrumb(get_the_archive_title(), 'calendar'); ?>
<?php include(TEMPLATEPATH . '/components/preview-list.php'); ?>
</main>
<?php get_sidebar(); ?>

View file

@ -1,20 +1,8 @@
<?php get_header(); ?> <!-- ouvrir header,php -->
<main>
<?php
$category = get_category( get_query_var( 'cat' ) );
$cat_id = $category->cat_ID; ?>
<div class="flex-that">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<?php echo site_url(); ?>">kazhnuz.space</a></li><li class="breadcrumb-item" aria-current="page"><span class="active"><i class="fa fa-folder-open"></i> <?php echo single_cat_title(); ?></span></li>
</ol>
</nav>
<div class="rss">
<?php echo '<a href="' . get_category_link( $cat_id ) . 'feed/" title="RSS de la categorie" class="btn btn-orange" /><i class="fa fa-rss"></i></a>'; ?>
</div>
</div>
<?php $category = get_category( get_query_var( 'cat' ) );
kspace_cat_breadcrumb_with_rss(single_cat_title('', false), 'folder-open', 'la catégorie', get_category_link( $category->cat_ID ) . '/feed' );
?>
<?php include(TEMPLATEPATH . '/components/posts-list.php'); ?>
</main>

View file

@ -1,20 +1,8 @@
<?php get_header(); ?> <!-- ouvrir header,php -->
<main>
<?php
$category = get_category( get_query_var( 'cat' ) );
$cat_id = $category->cat_ID; ?>
<div class="flex-that">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<?php echo site_url(); ?>">kazhnuz.space</a></li><li class="breadcrumb-item" aria-current="page"><span class="active"><i class="fa fa-folder-open"></i> <?php echo single_cat_title(); ?></span></li>
</ol>
</nav>
<div class="rss">
<?php echo '<a href="' . get_category_link( $cat_id ) . 'feed/" title="RSS de la categorie" class="btn btn-orange" /><i class="fa fa-rss"></i></a>'; ?>
</div>
</div>
<?php $category = get_category( get_query_var( 'cat' ) );
kspace_cat_breadcrumb_with_rss(single_cat_title('', false), 'folder-open', 'la catégorie', get_category_link( $category->cat_ID ) . '/feed' );
?>
<?php include(TEMPLATEPATH . '/components/preview-list.php'); ?>
</main>
@ -22,7 +10,7 @@
<!-- 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-header"><i class="fa fa-folder-open" aria-hidden="true"></i> <?php echo single_cat_title(); ?></div>
<div class="card-body">
<?php the_archive_description() ?>
</div>

View file

@ -14,7 +14,7 @@
}
}
?><li class="breadcrumb-item" aria-current="page"><span class="active"><i class="fa fa-file"></i> <?php echo the_title(); ?></span></li>
?><li class="breadcrumb-item" aria-current="page"><span class="active"><i class="fa fa-file" aria-hidden="true"></i> <?php echo the_title(); ?></span></li>
</ol>
</nav>
</div>

View file

@ -5,7 +5,7 @@
$menu = wp_get_nav_menu_items($listmenu['social']);
if ($menu != null) {
foreach ($menu as $menuElement) {
echo '<li class="social-li"><a class="social-link" href="'. $menuElement->url .'" alt="'.$menuElement->title.'"><i class="fa fa-fw fa-'.$menuElement->title.'"></i></a></li> ';
echo '<li class="social-li"><a class="social-link" href="'. $menuElement->url .'" title="Accéder à mon '.$menuElement->title.'" aria-label="Accéder à mon '.$menuElement->title.'"><i class="fa fa-fw fa-'.$menuElement->title.'" aria-hidden="true"></i></a></li> ';
}
}
?>
@ -26,7 +26,7 @@
<div>
<p>Les contenus sont diffusé sous licence Creative Common Attribution - Partage à l'Identique 4.0 - hors mention contraire.</p>
<p>Ces licences vous autorise à partager et copier mes travaux, tant que vous me citiez en source, et que vous autorisez la même chose pour les travaux qui en seraient dérivés. N'hésitez pas à partager ! <i class="color-red fa fa-heart"></i></p>
<p>Ces licences vous autorise à partager et copier mes travaux, tant que vous me citiez en source, et que vous autorisez la même chose pour les travaux qui en seraient dérivés. N'hésitez pas à partager ! <i class="color-red fa fa-heart" aria-hidden="true"></i></p>
</div>
</div>
</footer>

View file

@ -109,6 +109,39 @@ add_action( 'flag_add_form_fields', 'flags_taxonomy_custom_fields_add' );
add_action( 'created_flag', 'save_taxonomy_custom_fields' );
add_action( 'edited_flag', 'save_taxonomy_custom_fields', 10, 2 );
function kspace_cat_breadcrumb_nav($categoryName, $icon) {
?>
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<?php echo site_url(); ?>">kazhnuz.space</a>
</li><li class="breadcrumb-item" aria-current="page">
<span class="active"><i class="fa fa-<?php echo $icon; ?>" aria-hidden="true"></i> <?php echo $categoryName; ?></span>
</li>
</ol>
</nav>
<?php
}
function kspace_cat_breadcrumb($categoryName, $icon) {
?>
<div class="flex-that">
<?php kspace_cat_breadcrumb_nav($categoryName, $icon); ?>
</div>
<?php
}
function kspace_cat_breadcrumb_with_rss($categoryName, $icon, $categoryType, $rssLink) {
?>
<div class="flex-that">
<?php kspace_cat_breadcrumb_nav($categoryName, $icon); ?>
<div class="rss">
<a href="<?php echo $rssLink; ?>" class="btn btn-orange" /><i class="fa fa-rss" aria-hidden="true"></i><span class="sr-only">Flux RSS de <?php echo $categoryType; ?></span></a>
</div>
</div>
<?php
}
/* 2. Réseaux sociaux
*
* Permet d'afficher les réseaux sociaux en bas du post.
@ -147,8 +180,8 @@ function mypost_social_sharing_buttons($content) {
// Add sharing button at the end of page/page content
$content .= '<!-- based on crunchify social sharing. Get your copy here: http://crunchify.me/1VIxAsz -->';
$content .= '<div class="reagir share-buttons">';
$content .= '<a class="btn-small btn-twitter" href="'. $twitterURL .'" target="_blank"><i alt="twitter" class="fa fa-fw fa-twitter"></i></a> ';
$content .= '<a class="btn-small btn-facebook" href="'.$facebookURL.'" target="_blank"><i alt="facebook" class="fa fa-fw fa-facebook"></i></a> ';
$content .= '<a class="btn-small btn-twitter" href="'. $twitterURL .'" target="_blank"><i aria-label="twitter" class="fa fa-fw fa-twitter"></i></a> ';
$content .= '<a class="btn-small btn-facebook" href="'.$facebookURL.'" target="_blank"><i aria-label="facebook" class="fa fa-fw fa-facebook"></i></a> ';
$content .= '<a title="Share to Diaspora*" class="btn-small btn-diaspora" href="'.$diasporaURL.'" target="_blank"><i class="fa fa-fw fa-diaspora"></i></a>';
$content .= '</div>';

View file

@ -2,14 +2,7 @@
<?php get_header(); ?> <!-- ouvrir header,php -->
<main>
<?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
<div class="flex-that">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class='breadcrumb-item'><a href='<?php echo site_url(); ?>'>kazhnuz.space</a></li><li class="breadcrumb-item" aria-current="page"><span class="active"><i class="fa fa-folder-open"></i> <?php echo the_title(); ?></span></li>
</ol>
</nav>
</div>
<?php kspace_cat_breadcrumb('Romans', 'folder-open'); ?>
<?php endwhile; ?>
<?php endif; ?>

14
tag.php
View file

@ -1,18 +1,8 @@
<?php get_header(); ?> <!-- ouvrir header,php -->
<main>
<?php $tag = get_category( get_query_var( 'tag' ) );
$tag_id = $tag->ID;?>
<div class="flex-that">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<?php echo site_url(); ?>">kazhnuz.space</a></li><li class="breadcrumb-item" aria-current="page"><span class="active"><i class="fa fa-tag"></i> <?php echo single_cat_title(); ?></span></li>
</ol>
</nav>
<div class="rss">
<?php echo '<a href="' . get_tag_link( $tag_id ) . 'feed/" title="RSS de la categorie" class="btn btn-orange" /><i class="fa fa-rss"></i></a>'; ?>
</div>
</div>
kspace_cat_breadcrumb_with_rss(single_cat_title('', false), 'tag', 'RSS du tag', get_tag_link( $tag->cat_ID ) . '/feed' );
?>
<?php include(TEMPLATEPATH . '/components/preview-list.php'); ?>
</main>
<!-- Sidebar custom pour contenir la description -->

View file

@ -1,17 +1,6 @@
<?php get_header(); ?> <!-- ouvrir header,php -->
<main>
<?php $tag = get_category( get_query_var( 'roman' ) );
$tag_id = get_queried_object()->term_id;?>
<div class="flex-that">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<?php echo site_url(); ?>">kazhnuz.space</a></li><li class="breadcrumb-item" aria-current="page"><span class="active"><i class="fa fa-book"></i> <?php echo single_cat_title(); ?></span></li>
</ol>
</nav>
<div class="rss">
<?php echo '<a href="' . get_tag_link( $tag_id ) . 'feed/" title="RSS de la categorie" class="btn btn-orange" /><i class="fa fa-rss"></i></a>'; ?>
</div>
</div>
<?php kspace_cat_breadcrumb(single_cat_title('', false), 'book'); ?>
<img class="cover" src="<?php
$term_meta = get_option( "taxonomy_term_$tag_id" );
@ -41,7 +30,7 @@
?>
<div class="card card-primary">
<div class="card-header"><i class="fa fa-list"></i> Chapitres</div>
<div class="card-header"><i class="fa fa-list" aria-hidden="true"></i> Chapitres</div>
<div class="card-menu">
<?php if($query->have_posts()) : ?>
<?php $i = 1; ?>