ACF + 同位素:过滤 Post 对象数据

ACF + Isotope: Filter Post Object Data

我正在尝试根据类别从名为 "Clients" 的自定义 post 类型中过滤数据。我需要显示的是每个特定客户的徽标。

我设置了 Post 个对象的转发器字段,因此我可以更改徽标的显示顺序。

我目前使用的是什么,但是我不知道如何合并 Post 对象选择器,因此出现的内容取决于我通过 Repeater 添加的实例。

Here is the link to the site.感谢任何答案!

请参阅下方我的仪表板设置的屏幕截图:

<ul id="filters">
                    <?php 
                        $terms = get_terms("category", array(
                            'orderby' => 'slug'
                        )); // get all categories, but you can use any taxonomy
                        $count = count($terms); //How many are they?
                        if ( $count > 0 ){  //If there are more than 0 terms
                            foreach ( $terms as $term ) {  //for each term:
                                echo "<li><a href='#' data-filter='.".$term->slug."'>" . $term->name . "</a></li>\n";
                                //create a list item with the current term slug for sorting, and name for label
                            }
                        } 
                    ?>
                </ul>


                <?php $the_query = new WP_Query(array(
                    'post_type' => 'clients',
                    'posts_per_page' => '-1',
                    'order' => 'ASC'
                    )); //Check the WP_Query docs to see how you can limit which posts to display ?>

                <?php if ( $the_query->have_posts() ) : ?>
                    <div class="isotope-list-container">
                        <div id="isotope-list" class="row small-up-1 medium-up-2 large-up-3">
                        <?php while ( $the_query->have_posts() ) : $the_query->the_post(); 
                        $termsArray = get_the_terms( $post->ID, "category" );  //Get the terms for this particular item
                        $termsString = ""; //initialize the string that will contain the terms
                            foreach ( $termsArray as $term ) { // for each term 
                                $termsString .= $term->slug.' '; //create a string that has all the slugs 
                            }
                        ?> 
                        <div class="<?php echo $termsString; ?> portfolio columns"> <?php // 'portfolio' is used as an identifier (see Setp 5, line 6) ?>
                            <div class="portfolio-item-container">
                                <?php 
                                    $image = get_field('logo');
                                    if( !empty($image) ): ?>
                                        <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
                                    <?php endif; ?>
                                </div>
                        </div> <!-- end portfolio item -->
                        <?php endwhile;  ?>
                        </div> <!-- end isotope-list -->
                    </div>
                <?php endif; ?>
                <?php wp_reset_query(); ?>

通过使用 Post Types Order 插件重新排序我的帖子,我能够使这变得相当简单。

https://wordpress.org/plugins/post-types-order/