Hide Categories in Submission Form – Set Default Category

Home Forums Calendar Products Community Events Hide Categories in Submission Form – Set Default Category

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1151488
    David Akers
    Participant

    Following up from ticket https://theeventscalendar.com/support/forums/topic/hide-categories-in-submission-form-set-default-category/#post-1141743

    I’ve read through other similar threads – and you mention in those also selecting the desired default category via jQuery.

    It would be most helpful to me, and I’m sure others with a similar situation if you could elaborate a little on that process. You provided the code, but how and where do you implement the jQuery script?

    The link you provided in one thread (https://www.inkthemes.com/how-to-implement-custom-jquery-and-css-in-wordpress-plugin/) is not very helpful – as we’re not trying to build a plugin from scratch.

    #1151854
    Andras
    Keymaster

    Hi David,

    Thanks for reaching out. Let me try to give you a hand with this:

    First, create the JavaScript File – demo_script.js and put it in your child theme’s folder.

    Then add the following code to your functions.php file, this will call the script:


    function call_my_scripts() {
    wp_enqueue_script( 'script', get_template_directory_uri() . '/demo_script.js', array('jquery'));
    }
    add_action('init', 'call_my_scripts');

    Let me know if this gets you started.

    Cheers,
    Andras

    #1160447
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Hide Categories in Submission Form – Set Default Category’ is closed to new replies.