events-calendar-pro/src/resources/css/widget-calendar-full.css does not…

Home Forums Calendar Products Events Calendar PRO events-calendar-pro/src/resources/css/widget-calendar-full.css does not…

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1184630
    Kristian
    Participant

    events-calendar-pro/src/resources/css/widget-calendar-full.css does not get picked up by Autoptimize.

    Expected result: Autoptimize fetches properly hooked stylesheets and javascript files; concatenates and minifies them.

    However the above CSS is not picked up by Autoptimize, instead it is printed inline in the HTML – not in or in the footer for that matter.

    The css is registered using the Widget Class as of now, which might be too late for Autoptimize and other hooks. A possible fix is to simply register the script using a more convenient (and better placed) action, like so:

    add_action(‘wp_enqueue_scripts’, ‘example_register_scripts’);
    function example_register_scripts {
    wp_register_style(‘events-calendar-pro’, ‘css/file.css’, false, ‘1.0.0’);
    }

    (registered scripts are not printed until an action enqueues them)

    and then within whatever shortcode and/or Visual Composer component that requires the CSS you can use:
    wp_enqueue_style(‘events-calendar-pro’);

    this adds to benefits:
    First the CSS will not be placed within some strange place in the middle of the HTML within the first component. It might get placed in the footer (minor drawback compared to current behaviour).

    And the larger benefit that it will actually be picked up by autoptimize, concatenated and minified along with other files.

    #1185432
    Josh
    Participant

    Hey Kristian,

    Thanks for reaching out to us and bringing this to our attention.

    I’ve brought up the root of this issue with our team and will follow up based on whether there is a known reason why we aren’t using the “wp_enqueue_scripts” hook for the final hook up or when there may be an expected adjustment for this particular element.

    Thanks!

    #1195873
    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 ‘events-calendar-pro/src/resources/css/widget-calendar-full.css does not…’ is closed to new replies.