%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/cwg/wp-content/themes/cwg/
Upload File :
Create Path :
Current File : //var/www/cwg/wp-content/themes/cwg/artists.php

<?php

/**
 * The main template file
 * Template Name: Artists
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package onepoint
 */

global $post;

get_header();

$filters = get_field('filters');

$filter_not_ignored = [];

if(!empty($filters)) {
    foreach($filters as $filter) {
        isset($filter->slug) && array_push($filter_not_ignored, $filter->slug);
    }
}

function is_filter_ignored($filters_table, $filter_not_ignored)
{
    if (!empty($filters_table)) {
        $filter_simplified = [];
        foreach ($filters_table as $filter) {
            isset($filter->slug) && array_push($filter_simplified, $filter->slug);
        }
        $intersec_not_ignored = array_intersect($filter_simplified, $filter_not_ignored);
        return count($intersec_not_ignored) != 0;
    }
    return true;
}

$filter_to_send = [];
?>
<!----Should be placed when there is no carousel-->
<div class="js-headerGap h-[51px]"></div>

<div id="primary" class="content-area">

    <div class="js-collapsible js-extandWithPx w-full mt-[30px] h-full">
        <div class="js-collapsibleToggle cursor-pointer w-full transition-all duration-500 ease-in-out text-grey-textLight px-5 md:px-[60px]">
            <div class="w-full flex items-center">
                <div class="js-stroke w-[30px] h-0 border-t border-grey-textLight mr-1.5"></div>
                <span class="text-light text-[11px] uppercase">
                    See all artists
                </span>
                <span class="js-openIcon transform self-end ml-auto opacity-40">
                    <?php include(locate_template('/assets/img/expand-more.svg')); ?>
                </span>
            </div>
        </div>
        <div class="max-h-0 overflow-hidden transition-all duration-500 ease-in-out js-openable-element">
            <div class="grid grid-cols-2 md:grid-cols-6 gap-x-[46px] gap-y-4 md:gap-x-[54px] px-5 md:px-[60px] mt-[30px]">
                <?php
                $args = array(
                    'posts_per_page' => -1,
                    'post_status' => 'publish',
                    'post_type' => 'artists',
                    'orderby' => 'title',
                    'order' => 'ASC',
                );
                $wc_query = new WP_Query($args);
                while ($wc_query->have_posts()) :
                    $wc_query->the_post();
                ?>
                    <a href="<?= get_permalink() ?>" class="<?= is_filter_ignored(get_the_terms($post, 'artist-type'), $filter_not_ignored) ? '' : 'js-all-artist-element hidden' ?>">
                        <p class="uppercase text-[11px] font-medium leading-5 text-xs overflow-ellipsis whitespace-nowrap overflow-hidden"><?= the_title(); ?></p>
                    </a>
                <?php
                endwhile;
                wp_reset_postdata();
                ?>
            </div>
            <div class="pt-10 pb-6 md:hidden">
                <div class="w-full h-0 border-t border-grey-textLight"></div>
            </div>
        </div>
    </div>

    <main id="main" class="site-main">
        <?php
        while (have_posts()) :
            the_post();

            get_template_part('template-parts/content', 'page');

        endwhile; // End of the loop.
        ?>

    </main><!-- #main -->
</div><!-- #primary -->

<?php

get_footer();

?>

Zerion Mini Shell 1.0