Make the Item Filter to Scroll Down to the Result (PHP)

Question

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>
0
Icon 2 years 2019-11-03T23:24:08-05:00 0 Answers 74 views 0

Leave an answer

Browse
Browse