How to Add Multiple select to category filter - jquery

℡╲_俬逩灬. 提交于 2020-03-04 17:53:41

问题


I would like to add a multiple select to an image filter plugin that I have on wordpress. I am not a pro coder so not sure where to start, here to get some advise from you guys.

The plugin is here on this page https://elysian.dijestdesigns.com/voice/

At the moment you can only select one of the dropdown options and it filters, but I would like to be able to have a multiple select. I am hoping this could be done with Jquery.

The code is

<form role="search" method="get" id="searchform" class="etp-search-form extp-cat-inline" action="https://elysian.dijestdesigns.com/">
<div class="extp-search-group">

     <div class="extp-child_cat extp-cat-box">
        <ul class="extp-top-cat">
            <li class="extp-top-term extp-child-click" data-value="">
            <span>All</span>
            </li>
            <li class="extp-top-term extp-child-click extp-child-active" data-value="gender">GENDER
            <span class="extp-caret"></span>
                <ul class="extp-ul-child">
                    <li class="extp-child-click extp-child-active" data-value="female">Female</li>
                    <li class="extp-child-click" data-value="male">Male</li></ul></li>
                </ul>
     </div>

     <select name="extp_cat">
        <option value="">All</option>
        <option value="gender">GENDER</option><option value="female">— Female</option><option value="male">— Male</option>
    </select>

</div>
</form>

I have tried adding this Jquery in the footer, but it doesnt seem to do anything

<script src="path/to/jquery.multi-select.js" type="text/javascript"></script>
<script>
$('#searchform').multiSelect()
</script>

来源:https://stackoverflow.com/questions/59962575/how-to-add-multiple-select-to-category-filter-jquery

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!