category-29.php 1.44 KB
Newer Older
root's avatar
root committed
1 2
<?php

root's avatar
root committed
3 4
$maxMembersPerLine = 3;

root's avatar
root committed
5 6 7 8 9 10 11

get_header();

?>

<ul>

12
    <?php
root's avatar
root committed
13 14 15 16 17 18 19 20 21 22 23 24 25
    $order = "asc";


    $currentCategoryID = explode("=",$_SERVER['REQUEST_URI'])[1];

    $category = get_the_category_by_id($currentCategoryID);
    


    childrens_of_member_category($category);



root's avatar
root committed
26

root's avatar
root committed
27 28

    if (isset($_GET["order"])) {
29
        $order = $_GET["order"];
root's avatar
root committed
30

root's avatar
root committed
31 32
        if ($order != "asc" && $order != "desc") {
            $order = "asc";
33 34
        }
    }
root's avatar
root committed
35

36
    global $post;
root's avatar
root committed
37
    $args = array('posts_per_page' => 10, 'offset' => 0, 'cat' => $currentCategoryID, 'orderby' => 'title', 'order' => $order);
38 39 40 41 42 43

    ?>

    <?php

    $myposts = get_posts($args);
root's avatar
root committed
44 45 46 47 48 49 50
    echo "<br>";


    $count = 0;

    echo "<div class='adullact-members-list'>";
    echo "<div class='adullact-line'>";
51 52 53
    foreach ($myposts as $post) : setup_postdata($post);
        $id = get_the_id();
        $url = get_metadata("post", $id, "project_url")[0];
root's avatar
root committed
54
        $count +=1;
55
        ?>
root's avatar
root committed
56 57


root's avatar
root committed
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
        <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>";

74
    wp_reset_postdata(); ?>
root's avatar
root committed
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91

</ul>


<?php

//get_sidebar();

get_footer();

?>