Commit d09b4c39 authored by Nathan Peraldi's avatar Nathan Peraldi

add: all files for members categories

parent 0a62cf79
<?php
$themes_path = get_theme_root();
$theme_name = "/theme-wordpress-adullact-org";
$file_path = $themes_path . $theme_name . "/category-adherent.php";
include $file_path;
<?php
$themes_path = get_theme_root();
$theme_name = "/theme-wordpress-adullact-org";
$file_path = $themes_path . $theme_name . "/category-adherent.php";
include $file_path;
<?php
$themes_path = get_theme_root();
$theme_name = "/theme-wordpress-adullact-org";
$file_path = $themes_path . $theme_name . "/category-adherent.php";
include $file_path;
<?php
$themes_path = get_theme_root();
$theme_name = "/theme-wordpress-adullact-org";
$file_path = $themes_path . $theme_name . "/category-adherent.php";
include $file_path;
<?php
$themes_path = get_theme_root();
$theme_name = "/theme-wordpress-adullact-org";
$file_path = $themes_path . $theme_name . "/category-adherent.php";
include $file_path;
<?php
$themes_path = get_theme_root();
$theme_name = "/theme-wordpress-adullact-org";
$file_path = $themes_path . $theme_name . "/category-adherent.php";
//nombre de membres à afficher par ligne
$maxMembersPerLine = 3;
include $file_path;
get_header();
?>
<div class="wrap">
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<ul>
<?php
global $post; //variable wp
$order = "asc";
//on récup le nom de la catégorie de l'url
$category = explode("/", $_SERVER['REQUEST_URI'])[2];
//on récup le tri croissant / décroissant
if (isset($_GET["order"])) {
$order = $_GET["order"];
if ($order != "asc" && $order != "desc") {
$order = "asc";
}
}
$args = array('posts_per_page' => 10, 'offset' => 0, 'category_name' => $category, 'orderby' => 'title', 'order' => $order);
$myposts = get_posts($args);
echo "<br>";
$count = 0; //va servir pour les retour à la ligne lorsqu'on a affiché le max d'éléments par ligne
childrens_of_member_category("$category");
echo "<div class='adullact-members-list'>";
echo "<div class='adullact-line'>";
foreach ($myposts as $post) : setup_postdata($post);
$id = get_the_id();
$url = get_metadata("post", $id, "project_url")[0];
$count += 1;
?>
<a href="<?php echo $url; ?>" target="_blank" class="adullact-member">
<?php the_post_thumbnail(array("200", "200")); ?> <br>
<?php the_title(); ?> <br>
<?php the_tags($before = ''); ?>
</a>
<?php
if ($count >= $maxMembersPerLine) {
$count = 0;
echo "</div>";
echo "<div class='adullact-line'>";
}
endforeach;
echo "</div></div>";
wp_reset_postdata(); ?>
</ul>
</main>
</div>
</div>
<?php get_footer(); ?>
\ 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