A certain category should not be displayed, but it should be displayed elsewhere

The presentation of projects is defined in the template. The project category “Coming Soon” should now not be displayed in the upper area. The code was added to lines 31 to 37:

'meta_query' => array(
                array(
                    'key'     => 'project_kategorie',
                    'value'   => 'Coming Soon',
                    'compare' => 'NOT LIKE'
                )
            )

However, the “Coming Soon” category should be displayed again at the bottom (from line 140).

Here is the complete template:

<div class="mobile_spacer"></div>


<section class="row content_row">
    <div class="col col_12 col_10_sm col_shift_1_sm col_6_m col_shift_1-5_m">
        <div class="text big">
            <h1 class="hl"><?php the_field("page_hl"); ?></h1>
            <?php the_field("page_text"); ?>
        </div>
        <div class="link_ct">
            <br>
            <a href="#projektuebersicht" class="link">Zur Projektübersicht nach Kategorien</a>
        </div>
    </div>
</section>


    <?php

        $args = array(
            'numberposts' => -1,
            'post_type'   => 'project',
            'suppress_filters' => false,
            'meta_query' => array(
                array(
                    'key'     => 'project_kategorie',
                    'value'   => 'Coming Soon',
                    'compare' => 'NOT LIKE'
                )
            )
        );
         
        $projects = get_posts( $args);

    ?>




    <?php

        $project_array = [];
        $project_i = 1;
        $project_i_all = 1;
        $project_wrapper = "";
        $project_max_i = count($projects);
        foreach ($projects as $project) {

            $project_img = get_the_post_thumbnail_url($project, "large");

            $project_ct = '
                <a href="'.get_the_permalink($project).'" class="project_ct">
                    <div class="project_img">
                        <div class="project_img_overlay"></div>
                        <img src="'.$project_img.'" alt="">
                    </div>
                    <h2 class="project_hl">'.get_the_title($project).'</h2>
                    <h3 class="project_sl">'.get_field('project_subline', $project).'</h3>
                </a>
            ';

            $project_wrapper_mobile .= '<div class="col col_12 col_10_sm col_shift_1_sm">'.$project_ct.'</div>';


            $project_datum = get_field('project_datum', $project);
            if(get_field('project_datum', $project)){
                $project_datum = ", ".$project_datum;
            }
            $project_array[get_field('project_kategorie', $project)] .= '<li><a href="'.get_the_permalink($project).'">'.get_the_title($project).$project_datum.'</a></li>';


            if($project_i == 1){
                $project_wrapper .= '<section class="row project_row three_projects">';
            }
            else if($project_i == 4){
                $project_wrapper .= '<section class="row project_row two_projects">';
            }

            switch ($project_i) {
                case 1:
                case 2:
                case 3:
                    $project_wrapper .= '<div class="col col_12 col_10_sm col_shift_1_sm col_3_m col_shift_1-5_m">'.$project_ct.'</div>';
                    break;
                case 4:
                case 5:
                    $project_wrapper .= '<div class="col col_12 col_10_sm col_shift_1_sm col_5_m col_shift_1_m">'.$project_ct.'</div>';
                    break;
            }


            if($project_i == 3){
                $project_wrapper .= '</section>';
            }

            else if($project_i == 5){
                $project_wrapper .= '</section>';
                $project_i = 0;
            }

            if($project_max_i == $project_i_all && ($project_i != 3 && $project_i !== 5)){
                $project_wrapper .= '</section>';
            }

            $project_i++;
            $project_i_all++;

            ?>


            <?php
        }

    ?>


<div class="projects_wrapper_desktop hide show_m">
    <?php echo $project_wrapper; ?>
</div>

<div class="projects_wrapper_mobile hide_m">
    <section class="row content_row">
        <?php echo $project_wrapper_mobile; ?>
    </section>
</div>

<section class="row projektuebersicht_row" id="projektuebersicht">
    <div class="col col_12 col_10_sm col_shift_1_sm col_9_m col_shift_1-5_m">
        <div class="text big">
            <h2 class="hl">Projektübersicht</h2>
        </div>

        <div class="projects_kategorie_ct">


            <?php foreach ($project_array as $key => $value){ ?>

                <div class="projects_kategorie">
                    <h3><?php echo $key; ?></h3>
                    <ul>
                        <?php echo $value; ?>
                    </ul>
                </div>

            <?php } ?> 



        </div>
    </div>
</section>

Thank you for support. I’m still too new here…

New contributor

user24849097 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

1

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật