• Resolved gmariani405

    (@gmariani405)


    Is there a way to only have the CSS added to a page where the calendar is actually used? It seems to add it’s code and CSs on ALL pages, not just the one page that uses it. Can this be changed?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Spiffy Plugins

    (@spiffyplugins)

    Is there any particular reason why you want to do this? Browsers cache the CSS files, so it doesn’t make much difference in page loading and it would involve scanning each page for instances of all the shortcodes and widgets.

    Thread Starter gmariani405

    (@gmariani405)

    The issue is that the plugin is not relying on CSS in files, it’s writing it inline. Looking into it closer, the issue revolves around the Custom CSS option. That writes the CSS inline and not as a file. Please look at this page, you can see the <style id=’spiffycal-styles-inline-css’ type=’text/css’> inline:
    http://dev14.coursevector.com/contact-us/

    Here is the only page the calendar is actually used on: http://dev14.coursevector.com/news-events/calendar-of-events/

    But, even if you are referring to a file, shouldn’t it only be enqueued if the shortcode is being used on that page?

    WordPress and caching plugins are able to run more efficiently the less CSS/JS that is written inline and more that is enqueued.

    Plugin Author Spiffy Plugins

    (@spiffyplugins)

    The plugin uses a combination of a default file, with custom CSS added inline.

    I will look into the possibility of splitting the enqueue into a register/enqueue pairing if that still works with inline CSS.

    Plugin Author Spiffy Plugins

    (@spiffyplugins)

    Please try version 3.5.10 of the plugin, which has been updated to resolve this.

    Thread Starter gmariani405

    (@gmariani405)

    Excellent, I still see the inline CSS but as long as it’s only the calendar page that’s good enough for me. thank you for the quick turnaround!

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

The topic ‘Conditionally add CSS?’ is closed to new replies.