Commit 9dba2417 authored by Matthieu FAURE's avatar Matthieu FAURE

Merge branch '26-les-adherents-devraient-etre-des-pages-et-non-des-articles' into 'master'

Resolve "Les adhérents devraient être des pages et non des articles"

Closes #26

See merge request !16
parents ff18bada ff9a5a38
...@@ -56,16 +56,17 @@ $max_member_numero = ($page * $maxMembersPerPage); ...@@ -56,16 +56,17 @@ $max_member_numero = ($page * $maxMembersPerPage);
</div> </div>
</div> </div>
<?php echo "<div class='adullact-members-list'>"; <?php echo "<div class='adullact-members-list'>";
$args = array('posts_per_page' => -1, 'offset' => "0", 'category_name' => $category, 'orderby' => 'title', 'order' => $order); $members_page = get_page_by_title("membres");
$myposts = get_posts($args); $args = array('child_of' => $members_page->ID, 'sort_order' => $order);
$mypages = get_pages($args);
$number_of_total_posts = count($myposts); //pour les pages $number_of_total_posts = count($mypages); //pour les pages
if (($number_of_total_posts == 0) || ($number_of_total_posts < $min_member_numero)) { if (($number_of_total_posts == 0) || ($number_of_total_posts < $min_member_numero)) {
echo "<h3>Aucun résultat.</h3>"; echo "<h3>Aucun résultat.</h3>";
$pagination = false; $pagination = false;
} else { } else {
$counter = 1; $counter = 1;
foreach ($myposts as $post) : setup_postdata($post); foreach ($mypages as $post) : setup_postdata($post);
if ($counter >= $min_member_numero) { if ($counter >= $min_member_numero) {
if ($counter <= $max_member_numero) { if ($counter <= $max_member_numero) {
$id = get_the_id(); $id = get_the_id();
......
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