Where do I put Jquery

This topic contains 4 replies, has 3 voices, and was last updated by  Guust 7 years, 11 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #379101

    Dotty Directory
    Full Member
    Post count: 254

    I found this support thread, which is now closed https://wpgeodirectory.com/support/topic/autofill-category/

    Could you let me know where the Jquery needs to be placed please?

    Thanks

    #379109

    Guust
    Moderator
    Post count: 29970

    GD > Design > Scripts > Footer scripts

    Thanks

    #379112

    Kor
    Moderator
    Post count: 16516

    And wrap it like this.

    
    
    <script type="text/javascript">
    jQuery(document).ready(function(){
        
        if(location.pathname == "/add-listing/")
        {
            $price_id = jQuery('[name="package_id"]:checked').val();
    
            if($price_id == 1)
            {
                jQuery('#gd_placecategory.chosen_select').val('8').change();
                setTimeout(function()
                {
                    jQuery('input[name = post_default_category][value = 8]').attr("checked", "checked");
                }, 2000);
    
            }
        
            if($price_id == 2)
            {
                jQuery('#gd_placecategory.chosen_select').val('7').change();
                setTimeout(function()
                {
                    jQuery('input[name = post_default_category][value = 7]').attr("checked", "checked");
                }, 2000);
            }
            
        }
    
    });
    </script>
    #379133

    Dotty Directory
    Full Member
    Post count: 254

    Ah. Thanks again!

    #379219

    Guust
    Moderator
    Post count: 29970

    You’re welcome 🙂

Viewing 5 posts - 1 through 5 (of 5 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount