I have the single category showing as a checkbox on the front end and have tried to use the method described at the link below to have the checkbox automatically checked. The category ID is 109 (only one category in use). It is not working.
https://wpgeodirectory.com/support/topic/set-default-category/
Here is the script. Can you see what is going wrong?
<script>
jQuery(document).ready(function(){
if(location.pathname == “/add-your-listing/?listing_type=gd_therapist”)
{
jQuery(‘#gd_therapistcategory.chosen_select’).val(‘109’).change();
setTimeout(function()
{
jQuery(‘input[name = post_default_category][value = ‘109]’).attr(“checked”, “checked”);
}, 2000);
}
});
</script>