Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
Tagged: 8.5.13, css, javascript
- This topic has 1 reply, 2 voices, and was last updated 10 years, 5 months ago by
Steven Zahm.
-
AuthorPosts
-
03/18/2016 at 6:34 pm #369718
Susan
ParticipantHow can I adjust the plugin so the CSS and JS files are only loaded on pages that have directory entries? I have the following files loading on every page:
/wp-content/plugins/connections/assets/css/cn-user.min.css
/wp-content/plugins/connections/vendor/chosen/chosen.min.css
/wp-content/plugins/cmap-directory/cmap-directory.min.css (this is the customized version of cmap we use)
/wp-content/plugins/connections/vendor/picturefill/picturefill.min.jsDirectory entries are only displayed on a small percentage of pages on our site, so it would be more efficient to only load the files where needed.
I’ve found directions for de-queuing plugin files globally and then enqueuing them for specific pages, but that means that every time we make a change involving the directory I have to make sure the page id’s are correct in the functions file. Most of the plugins we use only call scrips and styles where required – is it possible to have Connections do the same?Thanks, Susan
03/21/2016 at 10:16 am #369870Steven Zahm
Keymaster@ Susan
re: Most of the plugins we use only call scrips and styles where required – is it possible to have Connections do the same?
Other than de-enqueuing them and then re-enqueueing them, sorry, no. I did have this at one time but quickly removed it because many users use the shortcode in places that can not be checked for in the post/page content (which is how other plugins do it). So examples. In text widgets and a few visual page builder plugins/themes that are popular enough that they can not be ignored.
The extra files have no impact beyond the first page load by a visitor anyway because the browser will cache the files and use them on subsequent page visits by the user. You probably better off from a performance standpoint to use a caching plugin like WP Rocket which minifies (Connections scripts are already minified) and concatenates CSS/JavaScript files.
Hope that answers your question thoroughly.
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.
