Hi Vimal,
Thanks for writing back and for sharing the screenshot.
If you'll note closely the text "2 specialisaties" can have two possible states:
A. When no specialisatie is selected, it should show the count of "specialisme" type posts, i.e. "X specialisaties"
B. When a specialisatie is selected in the filter field, it should show "1 specialisatie".
To dynamically switch between these two states, you can follow these steps:
1. Update the following content line from:
<span class="sub-title">[wpv-found-count] diensten in [postcount] specialisaties</span>
To:
<span class="sub-title">[wpv-found-count] diensten in <span class="sub-title-multiple">[postcount] specialisaties</span><span class="sub-title-single" style="display: none;">1 specialisatie</span></span>
Note, how the text for both cases is included in separate span tags, but the one for the case B is hidden, at the start.
2. In the "JS editor" tab under the "Zoeken en paginering" section, include the following script:
( screenshot: lien caché )
function updateSpecialisaties() {
var specialisme = jQuery("div.form-group > select#wpv_control_select_wpcf-related-specialisme").val();
if (specialisme > 0)
{
jQuery("span.sub-title-multiple").hide();
jQuery("span.sub-title-single").show();
}
else
{
jQuery("span.sub-title-single").hide();
jQuery("span.sub-title-multiple").show();
}
}
It will detect the value selected for the specialisatie filter field and will show/hide the specialisatie text, accordingly.
3. Lastly, add "updateSpecialisaties" text in the "zal uitgevoerd worden na het updaten van de resultaten" field, so that script is executed when the results are updated through AJAX.
( screenshot: lien caché )
I hope this helps and for more personalized assistance around custom code, you can consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/
regards,
Waqar