Compare commits
No commits in common. "0b3132d2bc8593fd6c5d9e33abd3fbdd6d0de875" and "52dc0b9c5cec9e451fc10bbe6ca33b925f10f0dc" have entirely different histories.
0b3132d2bc
...
52dc0b9c5c
25 changed files with 384 additions and 524 deletions
|
@ -17,8 +17,8 @@
|
||||||
|
|
||||||
if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
|
if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
|
||||||
|
|
||||||
<article class="card head-primary" id="post-<?php the_ID(); ?>">
|
<div class="card card-primary" id="post-<?php the_ID(); ?>">
|
||||||
<h1 class="card-header"><?php the_title(); ?></h1>
|
<div class="card-header"><h1><?php the_title(); ?></h1></div>
|
||||||
<div class="flex-that mb">
|
<div class="flex-that mb">
|
||||||
<div class="article-category">
|
<div class="article-category">
|
||||||
<?php $category = get_the_category();
|
<?php $category = get_the_category();
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
</div>
|
</div>
|
||||||
<?php the_excerpt(); ?>
|
<?php the_excerpt(); ?>
|
||||||
<p class="align-center"> <a href="<?php the_permalink(); ?>" class="btn btn-readmore" title="<?php the_title();?>">Lire l'article</a> </p>
|
<p class="align-center"> <a href="<?php the_permalink(); ?>" class="btn btn-readmore" title="<?php the_title();?>">Lire l'article</a> </p>
|
||||||
</article>
|
</div>
|
||||||
|
|
||||||
<?php endwhile; ?> <?php wp_reset_query(); /*4*/ ?>
|
<?php endwhile; ?> <?php wp_reset_query(); /*4*/ ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -10,12 +10,6 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<li class="social-li">
|
|
||||||
<a class="social-link" href="<?php bloginfo('rss2_url'); ?>">
|
|
||||||
<i class="fa fa-fw fa-rss" aria-hidden="true"></i>
|
|
||||||
<span class='sr-only'>Flux RSS du site</span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li class="social-li">
|
<li class="social-li">
|
||||||
<a class="social-link" href="https://kazhnuz.space/links">
|
<a class="social-link" href="https://kazhnuz.space/links">
|
||||||
<i class="fa fa-fw fa-ellipsis-h" aria-hidden="true"></i>
|
<i class="fa fa-fw fa-ellipsis-h" aria-hidden="true"></i>
|
||||||
|
|
|
@ -18,37 +18,21 @@
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<?php
|
|
||||||
$parent_categories = get_categories( array(
|
|
||||||
'orderby' => 'slug',
|
|
||||||
'order' => 'ASC',
|
|
||||||
'parent' => 0
|
|
||||||
) );
|
|
||||||
|
|
||||||
foreach( $parent_categories as $parent_category ) {
|
|
||||||
?>
|
|
||||||
<ul>
|
<ul>
|
||||||
<h2><?php echo $parent_category->name ?></h2>
|
<h2>Liste des catégories</h2>
|
||||||
<?php
|
<?php
|
||||||
$categories = get_categories( array(
|
$categories = get_categories( array(
|
||||||
'orderby' => 'slug',
|
'orderby' => 'name',
|
||||||
'order' => 'ASC',
|
'order' => 'ASC'
|
||||||
'parent' => $parent_category->term_id
|
|
||||||
) );
|
) );
|
||||||
|
|
||||||
foreach( $categories as $category ) {
|
foreach( $categories as $category ) {?>
|
||||||
if ($category->slug != "chapters") {
|
<li>
|
||||||
echo "<!-- " . get_category_link($category->term_id) . " -->";
|
<a class="menu-item" href="<?php echo get_category_link($category->term_id) ?>"><?php echo $category->name ?></a>
|
||||||
echo '<li><a class="menu-element" href="' . get_category_link($category->term_id) . '">' . $category->name . '</a></li>';
|
</li>
|
||||||
}
|
<?php }
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<ul>
|
<ul>
|
||||||
<h2>Pages</h2>
|
<h2>Pages</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<nav class="container menu toolbar flex-that fg-light d-none d-flex-sm">
|
<nav class="container menu toolbar flex-that fg-light">
|
||||||
<h2 class="sr-only">Menu des pages</h2>
|
<h2 class="sr-only">Menu des pages</h2>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
|
@ -6,6 +6,7 @@
|
||||||
<i class="fa fa-home" aria-hidden="true"></i><span class="sr-only">Accueil</span>
|
<i class="fa fa-home" aria-hidden="true"></i><span class="sr-only">Accueil</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<?php include(TEMPLATEPATH . '/components/navbar-category.php'); ?>
|
||||||
<?php
|
<?php
|
||||||
$listmenu = get_nav_menu_locations();
|
$listmenu = get_nav_menu_locations();
|
||||||
$menu = wp_get_nav_menu_items($listmenu['top-navbar']);
|
$menu = wp_get_nav_menu_items($listmenu['top-navbar']);
|
||||||
|
@ -20,21 +21,9 @@
|
||||||
$listmenu = get_nav_menu_locations();
|
$listmenu = get_nav_menu_locations();
|
||||||
$menu = wp_get_nav_menu_items($listmenu['top-navbar-2']);
|
$menu = wp_get_nav_menu_items($listmenu['top-navbar-2']);
|
||||||
foreach ($menu as $menuElement) {
|
foreach ($menu as $menuElement) {
|
||||||
echo '<li class="d-none d-block-sm"><a href="' . $menuElement->url . '" class="btn btn-navbar">'. $menuElement->title . '</a></li>';
|
echo '<li><a href="' . $menuElement->url . '" class="btn btn-navbar">'. $menuElement->title . '</a></li>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<li>
|
|
||||||
<a class="menu-item submenu" href="#">Mes sites <i class="fa fa-caret-down" aria-hidden="true"></i></a>
|
|
||||||
<ul class="bg-light menu fg-dark">
|
|
||||||
<?php
|
|
||||||
$listmenu = get_nav_menu_locations();
|
|
||||||
$menu = wp_get_nav_menu_items($listmenu['link-menu']);
|
|
||||||
foreach ($menu as $menuElement) {
|
|
||||||
echo '<li><a href="' . $menuElement->url . '" class="btn btn-navbar">'. $menuElement->title . '</a></li>';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li><a href="<?php bloginfo('rss2_url'); ?>" class="btn btn-navbar"><i class="fa fa-rss" aria-hidden="true"></i><span class="sr-only">Flux RSS du site</span></a></li>
|
<li><a href="<?php bloginfo('rss2_url'); ?>" class="btn btn-navbar"><i class="fa fa-rss" aria-hidden="true"></i><span class="sr-only">Flux RSS du site</span></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php if(have_posts()) : ?>
|
<?php if(have_posts()) : ?>
|
||||||
<div class="preview-grid">
|
<div class="preview-grid">
|
||||||
<?php while(have_posts()) : the_post(); ?>
|
<?php while(have_posts()) : the_post(); ?>
|
||||||
<article class="card card-preview head-primary">
|
<article class="card card-preview card-primary">
|
||||||
<a href="<?php the_permalink(); ?>" class="preview-link">
|
<a href="<?php the_permalink(); ?>" class="preview-link">
|
||||||
<h1 class="card-header"><?php the_title(); ?></h1>
|
<h1 class="card-header"><?php the_title(); ?></h1>
|
||||||
<div class="preview-content">
|
<div class="preview-content">
|
||||||
|
|
|
@ -2,3 +2,4 @@
|
||||||
<?php include(TEMPLATEPATH . '/components/sidebar/categories.php'); ?>
|
<?php include(TEMPLATEPATH . '/components/sidebar/categories.php'); ?>
|
||||||
<?php include(TEMPLATEPATH . '/components/sidebar/tags.php'); ?>
|
<?php include(TEMPLATEPATH . '/components/sidebar/tags.php'); ?>
|
||||||
<?php include(TEMPLATEPATH . '/components/sidebar/archives.php'); ?>
|
<?php include(TEMPLATEPATH . '/components/sidebar/archives.php'); ?>
|
||||||
|
<?php include(TEMPLATEPATH . '/components/sidebar/links.php'); ?>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
foreach( $parent_categories as $parent_category ) {
|
foreach( $parent_categories as $parent_category ) {
|
||||||
?>
|
?>
|
||||||
<section class="card head-primary d-none d-block-sm">
|
<section class="card head-primary">
|
||||||
<h2 class="card-header"><i class="fa fa-folder" aria-hidden="true"></i> <?php echo $parent_category->name ?></h2>
|
<h2 class="card-header"><i class="fa fa-folder" aria-hidden="true"></i> <?php echo $parent_category->name ?></h2>
|
||||||
<div class="menu fg-dark">
|
<div class="menu fg-dark">
|
||||||
<ul>
|
<ul>
|
||||||
|
|
351
functions.php
351
functions.php
|
@ -5,29 +5,336 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
include(TEMPLATEPATH . '/functions/posts-support.php');
|
|
||||||
include(TEMPLATEPATH . '/functions/niveaux.php');
|
|
||||||
include(TEMPLATEPATH . '/functions/flags.php');
|
|
||||||
include(TEMPLATEPATH . '/functions/breadcrumb.php');
|
|
||||||
include(TEMPLATEPATH . '/functions/tags-moreinfo.php');
|
|
||||||
include(TEMPLATEPATH . '/functions/profile-extra-fields.php');
|
|
||||||
include(TEMPLATEPATH . '/functions/romans.php');
|
|
||||||
include(TEMPLATEPATH . '/functions/reading-time.php');
|
|
||||||
include(TEMPLATEPATH . '/functions/cat-template.php');
|
|
||||||
|
|
||||||
function wpb_custom_new_menu() {
|
/* 0. Excerpt and thumbnail support
|
||||||
register_nav_menus(
|
*
|
||||||
array(
|
* Ces fonctions ajoutent les fonctionnalités de base du theme,
|
||||||
'top-navbar' => __( 'Navbar (gauche)' ),
|
* tel que les extraits et les miniatures.
|
||||||
'top-navbar-2' => __( 'Navbar (droite)' ),
|
*/
|
||||||
'link-menu' => __( 'Liste des liens' ),
|
|
||||||
'footer-pages' => __( 'Pages dans le footer' ),
|
function kspace_post_supports() {
|
||||||
'social' => __( 'Reseaux sociaux' ),
|
add_post_type_support( 'post', 'excerpt');
|
||||||
'social-plus' => __( 'Reseaux sociaux supplémentaires' ),
|
}
|
||||||
)
|
|
||||||
);
|
add_action( 'init', 'kspace_post_supports' );
|
||||||
|
|
||||||
|
add_theme_support( 'post-thumbnails' );
|
||||||
|
set_post_thumbnail_size( 825, 825, true );
|
||||||
|
|
||||||
|
/* 1. Niveau support
|
||||||
|
*
|
||||||
|
* Permet d'afficher les niveaux de post pour les post features
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 1.1 - Enregistrement de la taxonomy pour le flag
|
||||||
|
register_taxonomy(
|
||||||
|
'flag',
|
||||||
|
'post',
|
||||||
|
array(
|
||||||
|
'label' => 'Flag',
|
||||||
|
'labels' => array(
|
||||||
|
'name' => 'Flags',
|
||||||
|
'singular_name' => 'Flag',
|
||||||
|
'all_items' => 'Tous les flags',
|
||||||
|
'edit_item' => 'Éditer le flag',
|
||||||
|
'view_item' => 'Voir le flag',
|
||||||
|
'update_item' => 'Mettre à jour le flag',
|
||||||
|
'add_new_item' => 'Ajouter un flag',
|
||||||
|
'new_item_name' => 'Nouveau flag',
|
||||||
|
'search_items' => 'Rechercher parmi les flags',
|
||||||
|
'popular_items' => 'Flags les plus utilisés'
|
||||||
|
),
|
||||||
|
'hierarchical' => false
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
register_taxonomy_for_object_type( 'flag', 'post' );
|
||||||
|
|
||||||
|
// 1.2 - Ajout/Modif du niveau du flag
|
||||||
|
function flags_taxonomy_custom_fields($tag) {
|
||||||
|
// Check for existing taxonomy meta for the term you're editing
|
||||||
|
$t_id = $tag->term_id; // Get the ID of the term you're editing
|
||||||
|
$term_meta = get_option( "taxonomy_term_$t_id" ); // Do the check
|
||||||
|
?>
|
||||||
|
|
||||||
|
<tr class="form-field">
|
||||||
|
<th scope="row" valign="top">
|
||||||
|
<label for="niveau"><?php _e('Niveau du flag'); ?></label>
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="term_meta[niveau]" id="term_meta[niveau]" size="25" style="width:60%;" value="<?php echo $term_meta['niveau'] ? $term_meta['niveau'] : ''; ?>"><br />
|
||||||
|
<span class="description"><?php _e('Le niveau du flag (info, warning, danger…)'); ?></span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<?php
|
||||||
}
|
}
|
||||||
add_action( 'init', 'wpb_custom_new_menu' );
|
|
||||||
|
function flags_taxonomy_custom_fields_add( $taxonomy ) {
|
||||||
|
// Check for existing taxonomy meta for the term you're editing
|
||||||
|
$t_id = $tag->term_id; // Get the ID of the term you're editing
|
||||||
|
$term_meta = get_option( "taxonomy_term_$t_id" ); // Do the check
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="form-field">
|
||||||
|
<label for="term_meta[niveau]"><?php _e('Niveau du flag'); ?></label>
|
||||||
|
<input type="text" name="term_meta[niveau]" id="term_meta[niveau]" />
|
||||||
|
<p><?php _e('Le niveau du flag (info, warning, danger…)'); ?>.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
add_action( 'post_tag_edit_form_fields', 'kspace_edit_term_fields', 10, 2 );
|
||||||
|
|
||||||
|
// 1.3 - Sauvegarde du niveau du flag
|
||||||
|
function save_taxonomy_custom_fields( $term_id ) {
|
||||||
|
if ( isset( $_POST['term_meta'] ) ) {
|
||||||
|
$t_id = $term_id;
|
||||||
|
$term_meta = get_option( "taxonomy_term_$t_id" );
|
||||||
|
$cat_keys = array_keys( $_POST['term_meta'] );
|
||||||
|
foreach ( $cat_keys as $key ){
|
||||||
|
if ( isset( $_POST['term_meta'][$key] ) ){
|
||||||
|
$term_meta[$key] = $_POST['term_meta'][$key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//save the option array
|
||||||
|
update_option( "taxonomy_term_$t_id", $term_meta );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ajout des fields
|
||||||
|
add_action( 'flag_edit_form_fields', 'flags_taxonomy_custom_fields', 10, 2 );
|
||||||
|
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 d-none d-flex-sm pr-half pl-half">
|
||||||
|
<?php kspace_cat_breadcrumb_nav($categoryName, $icon); ?>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
function kspace_cat_breadcrumb_with_rss($categoryName, $icon, $categoryType, $rssLink) {
|
||||||
|
?>
|
||||||
|
<div class="flex-that d-none d-flex-sm pr-half pl-half">
|
||||||
|
<?php kspace_cat_breadcrumb_nav($categoryName, $icon); ?>
|
||||||
|
<div class="rss">
|
||||||
|
<a href="<?php echo $rssLink; ?>" class="btn btn-warning d-block m-0" /><i class="fa fa-rss" aria-hidden="true"></i><span class="sr-only">Flux RSS de <?php echo $categoryType; ?></span></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 3. Plus d'info sur les tags
|
||||||
|
*
|
||||||
|
* Permet d'afficher un lien vers plus d'informations.
|
||||||
|
* Le liens est gardé comme un champ supplémentaire dans les tags.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
add_action( 'post_tag_add_form_fields', 'kspace_add_term_fields' );
|
||||||
|
|
||||||
|
function kspace_add_term_fields( $taxonomy ) {
|
||||||
|
echo '<div class="form-field">
|
||||||
|
<label for="plus-dinfo">Plus d\'Info</label>
|
||||||
|
<input type="text" name="plus-dinfo" id="plus-dinfo" />
|
||||||
|
<p>Une URL permettant d\'obtenir plus d\'information sur le tag.</p>
|
||||||
|
</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
add_action( 'post_tag_edit_form_fields', 'kspace_edit_term_fields', 10, 2 );
|
||||||
|
|
||||||
|
function kspace_edit_term_fields( $term, $taxonomy ) {
|
||||||
|
|
||||||
|
$value = get_term_meta( $term->term_id, 'plus-dinfo', true );
|
||||||
|
|
||||||
|
echo '<tr class="form-field">
|
||||||
|
<th>
|
||||||
|
<label for="plus-dinfo">Plus d\'Info</label>
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<input name="plus-dinfo" id="plus-dinfo" type="text" value="' . esc_attr( $value ) .'" />
|
||||||
|
<p class="description">Une URL permettant d\'obtenir plus d\'information sur le tag.</p>
|
||||||
|
</td>
|
||||||
|
</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
add_action( 'created_post_tag', 'kspace_save_term_fields' );
|
||||||
|
add_action( 'edited_post_tag', 'kspace_save_term_fields' );
|
||||||
|
|
||||||
|
function kspace_save_term_fields( $term_id ) {
|
||||||
|
|
||||||
|
update_term_meta(
|
||||||
|
$term_id,
|
||||||
|
'plus-dinfo',
|
||||||
|
sanitize_text_field( $_POST[ 'plus-dinfo' ] )
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 3. Info supplémentaire sur profil utilisateur
|
||||||
|
*
|
||||||
|
* Permet d'afficher sous forme de chaine de caractères des infos supplémentaires qui seront
|
||||||
|
* transformé en un tableau..
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
add_action( 'show_user_profile', 'kspace_show_extra_profile_fields' );
|
||||||
|
add_action( 'edit_user_profile', 'kspace_show_extra_profile_fields' );
|
||||||
|
|
||||||
|
function kspace_show_extra_profile_fields( $user ) {
|
||||||
|
$year = get_the_author_meta( 'infodata', $user->ID );
|
||||||
|
?>
|
||||||
|
<h3><?php esc_html_e( 'More Info', 'kspace' ); ?></h3>
|
||||||
|
|
||||||
|
<table class="form-table">
|
||||||
|
<tr>
|
||||||
|
<th><label for="infodata"><?php esc_html_e( 'infodata', 'kspace' ); ?></label></th>
|
||||||
|
<td>
|
||||||
|
<input type="input"
|
||||||
|
id="infodata"
|
||||||
|
name="infodata"
|
||||||
|
value="<?php echo esc_attr( $year ); ?>"
|
||||||
|
class="regular-text"
|
||||||
|
/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
add_action( 'personal_options_update', 'kspace_update_profile_fields' );
|
||||||
|
add_action( 'edit_user_profile_update', 'kspace_update_profile_fields' );
|
||||||
|
|
||||||
|
function kspace_update_profile_fields( $user_id ) {
|
||||||
|
if ( ! current_user_can( 'edit_user', $user_id ) ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
update_user_meta( $user_id, 'infodata', $_POST['infodata'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 4. Romans
|
||||||
|
*
|
||||||
|
* Permet de catégoriser des chapitres ensemble, via une catégorie spécifiques.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
register_taxonomy('roman', 'post',
|
||||||
|
array(
|
||||||
|
'label' => 'Roman',
|
||||||
|
'labels' => array(
|
||||||
|
'name' => 'Romans',
|
||||||
|
'singular_name' => 'Roman',
|
||||||
|
'all_items' => 'Tous les romans',
|
||||||
|
'edit_item' => 'Éditer le roman',
|
||||||
|
'view_item' => 'Voir le roman',
|
||||||
|
'update_item' => 'Mettre à jour le roman',
|
||||||
|
'add_new_item' => 'Ajouter un roman',
|
||||||
|
'new_item_name' => 'Nouveau roman',
|
||||||
|
'search_items' => 'Rechercher parmi les romans',
|
||||||
|
'popular_items' => 'Romans les plus utilisés'),
|
||||||
|
'rewrite' => array('slug' => 'roman'),
|
||||||
|
'hierarchical' => false,
|
||||||
|
'public' => true,
|
||||||
|
'hierarchical' => true,
|
||||||
|
'show_in_nav_menus' => true,
|
||||||
|
'has_archive' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
register_taxonomy_for_object_type( 'roman', 'post' );
|
||||||
|
|
||||||
|
// 1.2 - Ajout/Modif du niveau du flag
|
||||||
|
function romans_taxonomy_custom_fields($tag) {
|
||||||
|
// Check for existing taxonomy meta for the term you're editing
|
||||||
|
$t_id = $tag->term_id; // Get the ID of the term you're editing
|
||||||
|
$term_meta = get_option( "taxonomy_term_$t_id" ); // Do the check
|
||||||
|
?>
|
||||||
|
|
||||||
|
<tr class="form-field">
|
||||||
|
<th scope="row" valign="top">
|
||||||
|
<label for="niveau"><?php _e('Couverture du roman'); ?></label>
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="term_meta[cover]" id="term_meta[cover]" size="25" style="width:60%;" value="<?php echo $term_meta['cover'] ? $term_meta['cover'] : ''; ?>"><br />
|
||||||
|
<span class="description"><?php _e('La couverture du roman, sous format URL'); ?></span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
function romans_taxonomy_custom_fields_add( $taxonomy ) {
|
||||||
|
// Check for existing taxonomy meta for the term you're editing
|
||||||
|
$t_id = $tag->term_id; // Get the ID of the term you're editing
|
||||||
|
$term_meta = get_option( "taxonomy_term_$t_id" ); // Do the check
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="form-field">
|
||||||
|
<label for="term_meta[cover]"><?php _e('Couverture du roman'); ?></label>
|
||||||
|
<input type="text" name="term_meta[cover]" id="term_meta[cover]" />
|
||||||
|
<p><?php _e('La couverture du roman, sous format URL)'); ?>.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ajout des fields
|
||||||
|
add_action( 'roman_edit_form_fields', 'romans_taxonomy_custom_fields', 10, 2 );
|
||||||
|
add_action( 'roman_add_form_fields', 'romans_taxonomy_custom_fields_add' );
|
||||||
|
add_action( 'created_roman', 'save_taxonomy_custom_fields' );
|
||||||
|
add_action( 'edited_roman', 'save_taxonomy_custom_fields', 10, 2 );
|
||||||
|
|
||||||
|
/* 4. Menus custom
|
||||||
|
*
|
||||||
|
* Quelques menus custom
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
function wpb_custom_new_menu() {
|
||||||
|
register_nav_menus(
|
||||||
|
array(
|
||||||
|
'top-navbar' => __( 'Navbar (gauche)' ),
|
||||||
|
'top-navbar-2' => __( 'Navbar (droite)' ),
|
||||||
|
'link-menu' => __( 'Liste des liens' ),
|
||||||
|
'footer-pages' => __( 'Pages dans le footer' ),
|
||||||
|
'social' => __( 'Reseaux sociaux' ),
|
||||||
|
'social-plus' => __( 'Reseaux sociaux supplémentaires' ),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
add_action( 'init', 'wpb_custom_new_menu' );
|
||||||
|
|
||||||
//estimated reading time
|
//estimated reading time
|
||||||
?>
|
function reading_time() {
|
||||||
|
$content = get_post_field( 'post_content', $post->ID );
|
||||||
|
$word_count = str_word_count( strip_tags( $content ) );
|
||||||
|
$readingtime = ceil($word_count / 200);
|
||||||
|
|
||||||
|
if ($readingtime == 1) {
|
||||||
|
$timer = " minute";
|
||||||
|
} else {
|
||||||
|
$timer = " minutes";
|
||||||
|
}
|
||||||
|
$totalreadingtime = $readingtime . $timer;
|
||||||
|
|
||||||
|
return $totalreadingtime;
|
||||||
|
}
|
|
@ -1,40 +0,0 @@
|
||||||
<?php
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Breadcrumb supports
|
|
||||||
// Functions to show a breadcrumb
|
|
||||||
// @author Kazhnuz
|
|
||||||
|
|
||||||
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 d-none d-flex-sm pr-half pl-half">
|
|
||||||
<?php kspace_cat_breadcrumb_nav($categoryName, $icon); ?>
|
|
||||||
</div>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
|
|
||||||
function kspace_cat_breadcrumb_with_rss($categoryName, $icon, $categoryType, $rssLink) {
|
|
||||||
?>
|
|
||||||
<div class="flex-that d-none d-flex-sm pr-half pl-half">
|
|
||||||
<?php kspace_cat_breadcrumb_nav($categoryName, $icon); ?>
|
|
||||||
<div class="rss">
|
|
||||||
<a href="<?php echo $rssLink; ?>" class="btn btn-warning d-block m-0" /><i class="fa fa-rss" aria-hidden="true"></i><span class="sr-only">Flux RSS de <?php echo $categoryType; ?></span></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
|
|
@ -1,30 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
// Use a parent category slug if it exists
|
|
||||||
function child_force_category_template($template) {
|
|
||||||
$cat = get_query_var('cat');
|
|
||||||
$category = get_category($cat);
|
|
||||||
|
|
||||||
if ( file_exists(TEMPLATEPATH . '/category-' . $category->cat_ID . '.php') ) {
|
|
||||||
$cat_template = TEMPLATEPATH . '/category-' . $category ->cat_ID . '.php';
|
|
||||||
} elseif ( file_exists(TEMPLATEPATH . '/category-' . $category->slug . '.php') ) {
|
|
||||||
$cat_template = TEMPLATEPATH . '/category-' . $category ->slug . '.php';
|
|
||||||
} elseif ( file_exists(TEMPLATEPATH . '/category-' . $category->category_parent . '.php') ) {
|
|
||||||
$cat_template = TEMPLATEPATH . '/category-' . $category->category_parent . '.php';
|
|
||||||
} else {
|
|
||||||
// Get Parent Slug
|
|
||||||
$cat_parent = get_category($category->category_parent);
|
|
||||||
|
|
||||||
if ( file_exists(TEMPLATEPATH . '/category-' . $cat_parent->slug . '.php') ) {
|
|
||||||
$cat_template = TEMPLATEPATH . '/category-' . $cat_parent->slug . '.php';
|
|
||||||
} else {
|
|
||||||
$cat_template = $template;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return $cat_template;
|
|
||||||
}
|
|
||||||
add_action('category_template', 'child_force_category_template');
|
|
||||||
|
|
||||||
?>
|
|
|
@ -1,91 +0,0 @@
|
||||||
<?php
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Flags supports
|
|
||||||
// Allow to show a banner with a custom message, via a special taxonomy
|
|
||||||
//
|
|
||||||
// Version 0.1
|
|
||||||
|
|
||||||
// Register the taxonomy
|
|
||||||
register_taxonomy(
|
|
||||||
'flag',
|
|
||||||
'post',
|
|
||||||
array(
|
|
||||||
'label' => 'Flag',
|
|
||||||
'labels' => array(
|
|
||||||
'name' => 'Flags',
|
|
||||||
'singular_name' => 'Flag',
|
|
||||||
'all_items' => 'Tous les flags',
|
|
||||||
'edit_item' => 'Éditer le flag',
|
|
||||||
'view_item' => 'Voir le flag',
|
|
||||||
'update_item' => 'Mettre à jour le flag',
|
|
||||||
'add_new_item' => 'Ajouter un flag',
|
|
||||||
'new_item_name' => 'Nouveau flag',
|
|
||||||
'search_items' => 'Rechercher parmi les flags',
|
|
||||||
'popular_items' => 'Flags les plus utilisés'
|
|
||||||
),
|
|
||||||
'hierarchical' => false
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
register_taxonomy_for_object_type( 'flag', 'post' );
|
|
||||||
|
|
||||||
// Add field to be able to change the flags
|
|
||||||
function flags_taxonomy_custom_fields($tag) {
|
|
||||||
// Check for existing taxonomy meta for the term you're editing
|
|
||||||
$t_id = $tag->term_id; // Get the ID of the term you're editing
|
|
||||||
$term_meta = get_option( "taxonomy_term_$t_id" ); // Do the check
|
|
||||||
?>
|
|
||||||
|
|
||||||
<tr class="form-field">
|
|
||||||
<th scope="row" valign="top">
|
|
||||||
<label for="niveau"><?php _e('Niveau du flag'); ?></label>
|
|
||||||
</th>
|
|
||||||
<td>
|
|
||||||
<input type="text" name="term_meta[niveau]" id="term_meta[niveau]" size="25" style="width:60%;" value="<?php echo $term_meta['niveau'] ? $term_meta['niveau'] : ''; ?>"><br />
|
|
||||||
<span class="description"><?php _e('Le niveau du flag (info, warning, danger…)'); ?></span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
|
|
||||||
function flags_taxonomy_custom_fields_add( $taxonomy ) {
|
|
||||||
// Check for existing taxonomy meta for the term you're editing
|
|
||||||
$t_id = $tag->term_id; // Get the ID of the term you're editing
|
|
||||||
$term_meta = get_option( "taxonomy_term_$t_id" ); // Do the check
|
|
||||||
?>
|
|
||||||
|
|
||||||
<div class="form-field">
|
|
||||||
<label for="term_meta[niveau]"><?php _e('Niveau du flag'); ?></label>
|
|
||||||
<input type="text" name="term_meta[niveau]" id="term_meta[niveau]" />
|
|
||||||
<p><?php _e('Le niveau du flag (info, warning, danger…)'); ?>.</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
|
|
||||||
add_action( 'post_tag_edit_form_fields', 'kspace_edit_term_fields', 10, 2 );
|
|
||||||
|
|
||||||
// Sauvegarde du niveau du flag
|
|
||||||
function save_taxonomy_custom_fields( $term_id ) {
|
|
||||||
if ( isset( $_POST['term_meta'] ) ) {
|
|
||||||
$t_id = $term_id;
|
|
||||||
$term_meta = get_option( "taxonomy_term_$t_id" );
|
|
||||||
$cat_keys = array_keys( $_POST['term_meta'] );
|
|
||||||
foreach ( $cat_keys as $key ){
|
|
||||||
if ( isset( $_POST['term_meta'][$key] ) ){
|
|
||||||
$term_meta[$key] = $_POST['term_meta'][$key];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//save the option array
|
|
||||||
update_option( "taxonomy_term_$t_id", $term_meta );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ajout des fields
|
|
||||||
add_action( 'flag_edit_form_fields', 'flags_taxonomy_custom_fields', 10, 2 );
|
|
||||||
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 );
|
|
||||||
|
|
||||||
?>
|
|
|
@ -1,30 +0,0 @@
|
||||||
<?php
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Post level support
|
|
||||||
// Handle featured posts
|
|
||||||
//
|
|
||||||
// Version 0.1
|
|
||||||
|
|
||||||
register_taxonomy(
|
|
||||||
'niveau',
|
|
||||||
'post',
|
|
||||||
array(
|
|
||||||
'label' => 'Niveau',
|
|
||||||
'labels' => array(
|
|
||||||
'name' => 'Niveaux',
|
|
||||||
'singular_name' => 'Niveaux',
|
|
||||||
'all_items' => 'Tous les niveaux',
|
|
||||||
'edit_item' => 'Éditer le niveau',
|
|
||||||
'view_item' => 'Voir le niveau',
|
|
||||||
'update_item' => 'Mettre à jour le niveau',
|
|
||||||
'add_new_item' => 'Ajouter un niveau',
|
|
||||||
'new_item_name' => 'Nouveau niveau',
|
|
||||||
'search_items' => 'Rechercher parmi les niveaux',
|
|
||||||
'popular_items' => 'Niveaux les plus utilisés'
|
|
||||||
),
|
|
||||||
'hierarchical' => false
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
register_taxonomy_for_object_type( 'niveau', 'post' );
|
|
||||||
?>
|
|
|
@ -1,20 +0,0 @@
|
||||||
<?php
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Posts supports
|
|
||||||
// Activate the different elements supported by the posts
|
|
||||||
//
|
|
||||||
// Version 0.1
|
|
||||||
|
|
||||||
// Support des extraits
|
|
||||||
function kspace_post_supports() {
|
|
||||||
add_post_type_support( 'post', 'excerpt');
|
|
||||||
}
|
|
||||||
|
|
||||||
add_action( 'init', 'kspace_post_supports' );
|
|
||||||
|
|
||||||
// Support des thumbnails
|
|
||||||
add_theme_support( 'post-thumbnails' );
|
|
||||||
set_post_thumbnail_size( 825, 825, true );
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
|
|
@ -1,42 +0,0 @@
|
||||||
<?php
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Info supplémentaire sur profil utilisateur
|
|
||||||
// Permet d'afficher sous forme de chaine de caractères des infos supplémentaires qui seront
|
|
||||||
// transformé en un tableau.
|
|
||||||
|
|
||||||
add_action( 'show_user_profile', 'kspace_show_extra_profile_fields' );
|
|
||||||
add_action( 'edit_user_profile', 'kspace_show_extra_profile_fields' );
|
|
||||||
|
|
||||||
function kspace_show_extra_profile_fields( $user ) {
|
|
||||||
$year = get_the_author_meta( 'infodata', $user->ID );
|
|
||||||
?>
|
|
||||||
<h3><?php esc_html_e( 'More Info', 'kspace' ); ?></h3>
|
|
||||||
|
|
||||||
<table class="form-table">
|
|
||||||
<tr>
|
|
||||||
<th><label for="infodata"><?php esc_html_e( 'infodata', 'kspace' ); ?></label></th>
|
|
||||||
<td>
|
|
||||||
<input type="input"
|
|
||||||
id="infodata"
|
|
||||||
name="infodata"
|
|
||||||
value="<?php echo esc_attr( $year ); ?>"
|
|
||||||
class="regular-text"
|
|
||||||
/>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
|
|
||||||
add_action( 'personal_options_update', 'kspace_update_profile_fields' );
|
|
||||||
add_action( 'edit_user_profile_update', 'kspace_update_profile_fields' );
|
|
||||||
|
|
||||||
function kspace_update_profile_fields( $user_id ) {
|
|
||||||
if ( ! current_user_can( 'edit_user', $user_id ) ) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
update_user_meta( $user_id, 'infodata', $_POST['infodata'] );
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
|
@ -1,23 +0,0 @@
|
||||||
<?php
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Reading time
|
|
||||||
// Return the average reading time of an article
|
|
||||||
//
|
|
||||||
// Version 0.1
|
|
||||||
|
|
||||||
function reading_time() {
|
|
||||||
$content = get_post_field( 'post_content', $post->ID );
|
|
||||||
$word_count = str_word_count( strip_tags( $content ) );
|
|
||||||
$readingtime = ceil($word_count / 200);
|
|
||||||
|
|
||||||
if ($readingtime == 1) {
|
|
||||||
$timer = " minute";
|
|
||||||
} else {
|
|
||||||
$timer = " minutes";
|
|
||||||
}
|
|
||||||
$totalreadingtime = $readingtime . $timer;
|
|
||||||
|
|
||||||
return $totalreadingtime;
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
|
@ -1,73 +0,0 @@
|
||||||
<?php
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Romans
|
|
||||||
// Permet de catégoriser des chapitres ensemble, via une catégorie spécifiques.
|
|
||||||
//
|
|
||||||
|
|
||||||
register_taxonomy('roman', 'post',
|
|
||||||
array(
|
|
||||||
'label' => 'Roman',
|
|
||||||
'labels' => array(
|
|
||||||
'name' => 'Romans',
|
|
||||||
'singular_name' => 'Roman',
|
|
||||||
'all_items' => 'Tous les romans',
|
|
||||||
'edit_item' => 'Éditer le roman',
|
|
||||||
'view_item' => 'Voir le roman',
|
|
||||||
'update_item' => 'Mettre à jour le roman',
|
|
||||||
'add_new_item' => 'Ajouter un roman',
|
|
||||||
'new_item_name' => 'Nouveau roman',
|
|
||||||
'search_items' => 'Rechercher parmi les romans',
|
|
||||||
'popular_items' => 'Romans les plus utilisés'),
|
|
||||||
'rewrite' => array('slug' => 'roman'),
|
|
||||||
'hierarchical' => false,
|
|
||||||
'public' => true,
|
|
||||||
'hierarchical' => true,
|
|
||||||
'show_in_nav_menus' => true,
|
|
||||||
'has_archive' => true,
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
register_taxonomy_for_object_type( 'roman', 'post' );
|
|
||||||
|
|
||||||
// 1.2 - Ajout/Modif du niveau du flag
|
|
||||||
function romans_taxonomy_custom_fields($tag) {
|
|
||||||
// Check for existing taxonomy meta for the term you're editing
|
|
||||||
$t_id = $tag->term_id; // Get the ID of the term you're editing
|
|
||||||
$term_meta = get_option( "taxonomy_term_$t_id" ); // Do the check
|
|
||||||
?>
|
|
||||||
|
|
||||||
<tr class="form-field">
|
|
||||||
<th scope="row" valign="top">
|
|
||||||
<label for="niveau"><?php _e('Couverture du roman'); ?></label>
|
|
||||||
</th>
|
|
||||||
<td>
|
|
||||||
<input type="text" name="term_meta[cover]" id="term_meta[cover]" size="25" style="width:60%;" value="<?php echo $term_meta['cover'] ? $term_meta['cover'] : ''; ?>"><br />
|
|
||||||
<span class="description"><?php _e('La couverture du roman, sous format URL'); ?></span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
|
|
||||||
function romans_taxonomy_custom_fields_add( $taxonomy ) {
|
|
||||||
// Check for existing taxonomy meta for the term you're editing
|
|
||||||
$t_id = $tag->term_id; // Get the ID of the term you're editing
|
|
||||||
$term_meta = get_option( "taxonomy_term_$t_id" ); // Do the check
|
|
||||||
?>
|
|
||||||
|
|
||||||
<div class="form-field">
|
|
||||||
<label for="term_meta[cover]"><?php _e('Couverture du roman'); ?></label>
|
|
||||||
<input type="text" name="term_meta[cover]" id="term_meta[cover]" />
|
|
||||||
<p><?php _e('La couverture du roman, sous format URL)'); ?>.</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ajout des fields
|
|
||||||
add_action( 'roman_edit_form_fields', 'romans_taxonomy_custom_fields', 10, 2 );
|
|
||||||
add_action( 'roman_add_form_fields', 'romans_taxonomy_custom_fields_add' );
|
|
||||||
add_action( 'created_roman', 'save_taxonomy_custom_fields' );
|
|
||||||
add_action( 'edited_roman', 'save_taxonomy_custom_fields', 10, 2 );
|
|
||||||
|
|
||||||
?>
|
|
|
@ -1,50 +0,0 @@
|
||||||
<?php
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Tags - More Info
|
|
||||||
// Permet d'afficher un lien vers plus d'informations.
|
|
||||||
// Le liens est gardé comme un champ supplémentaire dans les tags.
|
|
||||||
//
|
|
||||||
|
|
||||||
|
|
||||||
add_action( 'post_tag_add_form_fields', 'kspace_add_term_fields_moreinfo' );
|
|
||||||
|
|
||||||
function kspace_add_term_fields_moreinfo( $taxonomy ) {
|
|
||||||
echo '<div class="form-field">
|
|
||||||
<label for="plus-dinfo">Plus d\'Info</label>
|
|
||||||
<input type="text" name="plus-dinfo" id="plus-dinfo" />
|
|
||||||
<p>Une URL permettant d\'obtenir plus d\'information sur le tag.</p>
|
|
||||||
</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
add_action( 'post_tag_edit_form_fields', 'kspace_edit_term_fields_moreinfo', 10, 2 );
|
|
||||||
|
|
||||||
function kspace_edit_term_fields_moreinfo( $term, $taxonomy ) {
|
|
||||||
|
|
||||||
$value = get_term_meta( $term->term_id, 'plus-dinfo', true );
|
|
||||||
|
|
||||||
echo '<tr class="form-field">
|
|
||||||
<th>
|
|
||||||
<label for="plus-dinfo">Plus d\'Info</label>
|
|
||||||
</th>
|
|
||||||
<td>
|
|
||||||
<input name="plus-dinfo" id="plus-dinfo" type="text" value="' . esc_attr( $value ) .'" />
|
|
||||||
<p class="description">Une URL permettant d\'obtenir plus d\'information sur le tag.</p>
|
|
||||||
</td>
|
|
||||||
</tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
add_action( 'created_post_tag', 'kspace_save_term_fields_moreinfo' );
|
|
||||||
add_action( 'edited_post_tag', 'kspace_save_term_fields_moreinfo' );
|
|
||||||
|
|
||||||
function kspace_save_term_fields_moreinfo( $term_id ) {
|
|
||||||
|
|
||||||
update_term_meta(
|
|
||||||
$term_id,
|
|
||||||
'plus-dinfo',
|
|
||||||
sanitize_text_field( $_POST[ 'plus-dinfo' ] )
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
|
|
@ -26,40 +26,19 @@
|
||||||
<?php wp_list_pages( 'sort_column=menu_order&depth=1&title_li=' ) ?>
|
<?php wp_list_pages( 'sort_column=menu_order&depth=1&title_li=' ) ?>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="mb-1">
|
<section class="mb-1">
|
||||||
<h2>Catégories</h2>
|
<h2>Catégories</h2>
|
||||||
|
|
||||||
<?php
|
|
||||||
$parent_categories = get_categories( array(
|
|
||||||
'orderby' => 'slug',
|
|
||||||
'order' => 'ASC',
|
|
||||||
'parent' => 0
|
|
||||||
) );
|
|
||||||
|
|
||||||
foreach( $parent_categories as $parent_category ) {
|
|
||||||
?>
|
|
||||||
<ul>
|
<ul>
|
||||||
<h3><?php echo $parent_category->name ?></h3>
|
|
||||||
<?php
|
<?php
|
||||||
$categories = get_categories( array(
|
$categories = get_categories( array(
|
||||||
'orderby' => 'slug',
|
'orderby' => 'name',
|
||||||
'order' => 'ASC',
|
'order' => 'ASC'
|
||||||
'parent' => $parent_category->term_id
|
) );
|
||||||
) );
|
|
||||||
|
|
||||||
foreach( $categories as $category ) {
|
foreach( $categories as $category ) {
|
||||||
if ($category->slug != "chapters") {
|
echo '<li><a href="' . get_category_link($category->term_id) . '">' . $category->name . '</a></li>';
|
||||||
echo "<!-- " . get_category_link($category->term_id) . " -->";
|
}?>
|
||||||
echo '<li><a href="' . get_category_link($category->term_id) . '">' . $category->name . '</a></li>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</section>
|
</section>
|
||||||
<section class="mb-1">
|
<section class="mb-1">
|
||||||
<h2>Archive des articles</h2>
|
<h2>Archive des articles</h2>
|
||||||
|
|
|
@ -23,7 +23,6 @@ $card-smallpad: $lineheight_rel / 4;
|
||||||
.fa {
|
.fa {
|
||||||
margin-right: 0.5em;
|
margin-right: 0.5em;
|
||||||
}
|
}
|
||||||
font-family: $basefont;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,7 @@
|
||||||
left: 0;
|
left: 0;
|
||||||
display: none;
|
display: none;
|
||||||
padding:0.33rem;
|
padding:0.33rem;
|
||||||
z-index:2;
|
z-index:1;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover ul,
|
&:hover ul,
|
||||||
|
|
|
@ -1,3 +1,14 @@
|
||||||
|
#featured-articles {
|
||||||
|
display:grid;
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
grid-template-rows: auto;
|
||||||
|
grid-gap: $lineheight;
|
||||||
|
padding-bottom: $lineheight;
|
||||||
|
@include lg() {
|
||||||
|
grid-template-columns: 1fr 1fr 1fr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.preview-featured {
|
.preview-featured {
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
|
|
||||||
|
|
|
@ -35,16 +35,10 @@
|
||||||
border-top: 6px solid get-color("dark");
|
border-top: 6px solid get-color("dark");
|
||||||
background-position: bottom center;
|
background-position: bottom center;
|
||||||
background-repeat: repeat-x;
|
background-repeat: repeat-x;
|
||||||
margin-bottom:-1.5rem;
|
margin-bottom:1.5rem;
|
||||||
padding-bottom:5rem;
|
|
||||||
.fa {
|
.fa {
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@include sm() {
|
|
||||||
padding-bottom: 0;
|
|
||||||
margin-bottom: 1.5rem;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
header h1 {
|
header h1 {
|
||||||
|
|
|
@ -14,8 +14,6 @@
|
||||||
@include sm() {
|
@include sm() {
|
||||||
display:none;
|
display:none;
|
||||||
}
|
}
|
||||||
|
|
||||||
z-index:10;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-button {
|
.menu-button {
|
||||||
|
@ -32,10 +30,10 @@
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
aspect-ratio: 1;
|
aspect-ratio: 1;
|
||||||
border-radius:999px;
|
border-radius:999px;
|
||||||
z-index: 12;
|
opacity: 0.75;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: $color-primary;
|
opacity:1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@include sm() {
|
@include sm() {
|
||||||
|
|
29
style.css
29
style.css
|
@ -1382,8 +1382,7 @@ nav.pagination {
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
border-radius: 0;
|
border-radius: 0; }
|
||||||
font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Cantarell, Roboto, Oxygen, Ubuntu, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; }
|
|
||||||
.card-header:before {
|
.card-header:before {
|
||||||
content: " ";
|
content: " ";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -1594,7 +1593,7 @@ ul.card-list, .card > ul {
|
||||||
left: 0;
|
left: 0;
|
||||||
display: none;
|
display: none;
|
||||||
padding: 0.33rem;
|
padding: 0.33rem;
|
||||||
z-index: 2; }
|
z-index: 1; }
|
||||||
.toolbar li:hover ul,
|
.toolbar li:hover ul,
|
||||||
.toolbar li ul:hover, .toolbar li:focus-within ul {
|
.toolbar li ul:hover, .toolbar li:focus-within ul {
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
|
@ -2464,14 +2463,10 @@ textarea {
|
||||||
border-top: 6px solid #002b36;
|
border-top: 6px solid #002b36;
|
||||||
background-position: bottom center;
|
background-position: bottom center;
|
||||||
background-repeat: repeat-x;
|
background-repeat: repeat-x;
|
||||||
margin-bottom: -1.5rem;
|
margin-bottom: 1.5rem; }
|
||||||
padding-bottom: 5rem; }
|
|
||||||
#page-header .fa {
|
#page-header .fa {
|
||||||
font-size: 1rem; }
|
font-size: 1rem; }
|
||||||
@media (min-width: 576px) {
|
|
||||||
#page-header {
|
|
||||||
padding-bottom: 0;
|
|
||||||
margin-bottom: 1.5rem; } }
|
|
||||||
header h1 {
|
header h1 {
|
||||||
border-style: none !important;
|
border-style: none !important;
|
||||||
font-weight: 800;
|
font-weight: 800;
|
||||||
|
@ -2973,6 +2968,15 @@ ul.social {
|
||||||
top: -240px;
|
top: -240px;
|
||||||
margin: auto; } }
|
margin: auto; } }
|
||||||
|
|
||||||
|
#featured-articles {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
grid-template-rows: auto;
|
||||||
|
grid-gap: 1.6rem;
|
||||||
|
padding-bottom: 1.6rem; }
|
||||||
|
@media (min-width: 992px) {
|
||||||
|
#featured-articles {
|
||||||
|
grid-template-columns: 1fr 1fr 1fr; } }
|
||||||
.preview-featured {
|
.preview-featured {
|
||||||
font-size: 0.8rem; }
|
font-size: 0.8rem; }
|
||||||
.preview-featured .preview-link {
|
.preview-featured .preview-link {
|
||||||
|
@ -3036,8 +3040,7 @@ ul.social {
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
transition: left 0.2s;
|
transition: left 0.2s;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
overflow: scroll;
|
overflow: scroll; }
|
||||||
z-index: 10; }
|
|
||||||
#mobile-sidebar.shown {
|
#mobile-sidebar.shown {
|
||||||
left: 0; }
|
left: 0; }
|
||||||
@media (min-width: 576px) {
|
@media (min-width: 576px) {
|
||||||
|
@ -3057,9 +3060,9 @@ ul.social {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
aspect-ratio: 1;
|
aspect-ratio: 1;
|
||||||
border-radius: 999px;
|
border-radius: 999px;
|
||||||
z-index: 12; }
|
opacity: 0.75; }
|
||||||
.menu-button:hover {
|
.menu-button:hover {
|
||||||
background-color: #CB357D; }
|
opacity: 1; }
|
||||||
@media (min-width: 576px) {
|
@media (min-width: 576px) {
|
||||||
.menu-button {
|
.menu-button {
|
||||||
display: none; } }
|
display: none; } }
|
||||||
|
|
Reference in a new issue