Commit b35d53d3 authored by root's avatar root

add: 2 functions for members list

parent 4772b76c
<?php
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
add_action('wp_enqueue_scripts', 'my_theme_enqueue_styles');
function my_theme_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
function my_theme_enqueue_styles()
{
wp_enqueue_style('parent-style', get_template_directory_uri() . '/style.css');
}
function childrens_of_member_category()
{
//cette fonction affiche la liste des catégories enfants de la catégorie mère Adhérent
$childrens = get_term_children(21, "category"); //contiendra les id de tous les enfants de adhérent
?>
<a href='?cat=21'>Tout</a>
<?php
foreach ($childrens as $c) {
$category = get_category($c); //objet contenant les infos de la catégorie enfant
?>
<a href='?cat=<?php echo $c; ?>'>
<?php echo $category->name; ?>
</a>
<?php
}
sort_page();
?>
<?php
}
function sort_page()
{
$link = explode("&order",$_SERVER['REQUEST_URI'])[0]
?>
<a href="<?php echo $link; ?>&order=asc">Croissant</a>
<a href="<?php echo $link; ?>&order=desc">Décroissant</a>
<?php
}
?>
?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment