Forums › Forums › Search & Filter Pro › I need to add a div wrapper to items in filter area
- This topic has 15 replies, 3 voices, and was last updated 4 years, 4 months ago by Ross.
-
Ross Moderator(Private) June 18, 2020 at 10:24 am #249308
Hi Florin
I don’t see much delay, but I do see what you mean.
The issue is both the JS and CSS need to load in, and our JS needs to run, and attach select2 before you actually see it.
What you could do, if you prefer, is hide the search from, until select2 is loaded, and then show it?
It could be as simple as adding some CSS to hide the search form:
.searchandfilter{ display: none; }
and then when S&F has init you can show it in javascript using our
sf:init
event (and you might need to do that again onsf:ajaxfinish
because the search form is replaced).Does that make sense?
Best
Anonymous(Private) June 18, 2020 at 10:28 am #249314Hi, Trevor,
Thanks a lot for helping with this. You lost me after adding the CSS “searchfilter {display:none}” 🙂
Can you tell me the code I need to add and where exactly? I am confortable with css and js, but not sure on where the above events reside and how to handle them.
Regards,
FlorinRoss Moderator(Private) June 19, 2020 at 7:11 pm #249511Hi Florin
So the CSS can be added to your theme anywhere your theme recommends adding CSS.
You can usually do this in your child theme folder, in
style.css
, but some themes have an admin area to add custom CSS.RE JavaScript (I guess that will be next) – this can be done a bunch of ways, one of them being similar to CSS, by adding it to the child theme – this article covers a few ways – https://calderaforms.com/2016/11/how-to-load-custom-javascript-in-wordpress/
Thanks
-
AuthorPosts