Commit 9ed7da86 authored by Nathan Peraldi's avatar Nathan Peraldi

delete bad wordpress div

parent 0282107c
<?php <?php
//nombre de membres à afficher par ligne //nombre de membres à afficher par ligne
$maxMembersPerLine = 3; $maxMembersPerLine = 4;
get_header(); get_header();
?> ?>
<div class="wrap"> <div class="wrap">
<div id="primary" class="content-area"> <main id="main" class="site-main" role="main">
<main id="main" class="site-main" role="main"> <ul id="adullact-member-list">
<ul id="adullact-member-list">
<?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");
?>
</ul>
<?php <?php
global $post; //variable wp
$order = "asc";
echo "<div class='adullact-members-list'>"; //on récup le nom de la catégorie de l'url
$category = explode("/", $_SERVER['REQUEST_URI'])[2];
echo "<div class='adullact-line'>"; //on récup le tri croissant / décroissant
foreach ($myposts as $post) : setup_postdata($post); if (isset($_GET["order"])) {
$id = get_the_id(); $order = $_GET["order"];
$url = get_metadata("post", $id, "project_url")[0];
$count += 1;
?>
<a href="<?php echo $url; ?>" target="_blank" class="adullact-member"> if ($order != "asc" && $order != "desc") {
<?php the_post_thumbnail(array("200", "200")); ?> <br> $order = "asc";
<?php the_title(); ?> <br>
<?php the_tags($before = ''); ?>
</a>
<?php
if ($count >= $maxMembersPerLine) {
$count = 0;
echo "</div>";
echo "<div class='adullact-line'>";
} }
}
$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");
?>
</ul>
<?php
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>
endforeach; <?php
echo "</div></div>"; if ($count >= $maxMembersPerLine) {
$count = 0;
wp_reset_postdata(); ?> echo "</div>";
echo "<div class='adullact-line'>";
</main> }
</div> endforeach;
echo "</div></div>";
wp_reset_postdata(); ?>
</main>
</div> </div>
<?php get_footer(); ?> <?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