I was working on a site recently where Soliloquy was used along with FacetWP, and in this case, clicking to go to the next or previous post would load in a Soliloquy slider dynamically. The problem I faced was that the slider being loaded was not automatically initialised.
Now my search for answers led me to a post on the Soliloquy Blog which suggested that I could use a neat JS function they’d already provided called soliloquyInitManually()
. The problem was, that although the JavaScript part existed, the PHP code required to initialise each slider had not been completed, so the function was more or less useless.
I was able to write my own JavaScript and PHP callback to get around the issue.
The JS will run after FacetWP has loaded, search for un-initialised Soliloquy sliders, and call our PHP function project_init_soliloquy_sliders
for each. The following PHP function is what’s called by AJAX, and should be placed in your theme functions.php
file.
One Comment
thanks so much!
added custom js and addes to custom php. worked like charm combining facetwp and soliloquy!!