Support » Fixing WordPress » problem in filtering category

  • hi,
    help me please for not loading “TEST3” filter :

    use script: mixitup

    code:

    
                    <section class="cat-box wide-box nov-special">
                <div class="cat-box-title nov-title-buy" id="nov-title-special"><h2>
                         <span>TITLE</span>
                    </h2></div>				
                <div class="cat-box-content">
                    <div class="filters">
                        <div class="filter active" data-filter="all">ALL</div>
                        <div class="filter" data-filter=".category-56">TEST1</div>
                        <div class="filter" data-filter=".category-441">TEST2</div>
                        <div class="filter" data-filter=".category-58">TEST3</div>
                    </div>
                    <ul id="nov-work" class="work-continer">
                          <?php
                        $work = new WP_Query(array(
                            'post_status' => 'publish',
                            'post_type' => 'download',
                            'orderby' => 'ID',
                            'posts_per_page' => 9,
                            'tax_query' => array(
                                array(
                                    'taxonomy' => 'download_category',
                                    'field' => 'id',
                                    'terms' => [56, 58, 441]
                                ),
                            ),
                            'paged' => (get_query_var('paged')) ? get_query_var('paged') : 1
                        ));
                        while ($work->have_posts()) : $work->the_post();
                            $categories = get_the_terms(get_the_ID(), 'download_category');
                            ?>
                            <li <?php tie_post_class(); ?> class="mix category-<?php if ($categories[0]->parent != '') {
                                echo $categories[0]->parent;
                            } else {
                                echo $categories[0]->term_taxonomy_id;
                            } ?>">
                                <div class="nov-li-special">
                                    <?php if (function_exists("has_post_thumbnail") && has_post_thumbnail()) : ?>
                                        <div class="post-thumbnail">
                                            <?php
                                            if ($categories[0]->parent == '441') { ?>
    											 <div class="info-post-icon">
                                                    <span class="icon-info-post plugin">
                                                    </span>
    
                                                <span class="info-post-text">
                                                    TEST2
                                                </span>
                                                </div>
                                            <?php } elseif ($categories[0]->parent == '56') {
                                                ?>
    											 <div class="info-post-icon">
    
                                                    <span class="icon-info-post theme">
                                                    </span>
    
                                                <span class="info-post-text">
                                                    TEST1
                                                </span>
                                                </div>
                                            <?php } elseif ($categories[0]->parent == '58' || $categories[0]->term_taxonomy_id == '58') {
                                                ?>
    											 <div class="info-post-icon">
    
                                                    <span class="icon-info-post learn">
                                                    </span>
    
                                                <span class="info-post-text">
                                                    TEST3
                                                </span>
                                                </div>
                                            <?php } ?>
    
                                            <a href="<?php the_permalink(); ?>"
                                               title="<?php printf(esc_attr__('%s', 'tie'), the_title_attribute('echo=0')); ?>"
                                               rel="bookmark"><?php tie_thumb('', 250, 150); ?></a>
                                        </div><!-- post-thumbnail /-->
                                    <?php endif; ?>
                                    <h3 class="post-box-title"><a href="<?php the_permalink(); ?>"
                                                                  title="<?php printf(esc_attr__('%s', 'tie'), the_title_attribute('echo=0')); ?>"
                                                                  rel="bookmark"><?php the_title(); ?></a></h3>
                                    <p class="post-meta">
                                        <?php tie_get_time() ?>
                                        <span><i
                                                class="tieicon-commentcount"></i><?php comments_popup_link('0', '1', '%'); ?></span>
                                        <span><?php echo getPostViews(get_the_ID()); ?></span>
                                    </p>
                                </div>
                            </li>
                        <?php endwhile; ?>
                    </ul>
                    <script>
                    jQuery(document).ready(function ($) {
                            $('.work-continer').mixItUp({
                                animation: {
                                    effects: 'fade translateX(100%)',
                                    reverseOut: true
                                }
                            });
        });
                    </script>
            </section>
    
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘problem in filtering category’ is closed to new replies.