0

I have a plugin with a filter installed on the WordPress site, currently, when you click on one of the items in the Filter List, it simply populates the results. The attached code below describes its functionality.

However, I need to make sure that in addition to just populating results (as it does now), I would like the browser windows to scroll down to the actual result.

Any suggestions what code should I add/modify there? Thanks in advance!

 <div class="filter-area">

                <?php 
                    $item_count_disp_all = 0;
                    foreach ($listItems as $item){
                        if( $item_count == "on" ){
                            @$item_count_disp_all += count(get_post_meta( $item->ID, 'qcopd_list_item01' ));
                        }
                    }
                ?>
                <a href="#" class="filter-btn filter-active" data-filter="all">
                    <?php 
                        if(testmodule_get_option('testmodule_lan_show_all')!=''){
                            echo esc_html(testmodule_get_option('testmodule_lan_show_all'));
                        }else{
                            _e('Show All', 'qc-opd'); 
                        }
                    ?>
                    <?php
                        if($item_count == 'on' and $infinityscroll!=1){
                            echo '<span class="opd-item-count-fil">('.esc_html($item_count_disp_all).')</span>';
                        }
                    ?>
                </a>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.