Skip Navigation

[Gelöst] Follow-up: Don't include CSS / JS in frontend that is not needed

This support ticket is created vor 8 Jahre, 1 Monat. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 4 Antworten, has 3 Stimmen.

Last updated by willem-siebeS vor 8 Jahre, 1 Monat.

Assigned support staff: Luo Yang.

Author
Artikel
#259902

Hi Adriano, thanks a lot for your answer on this topic: https://toolset.com/forums/topic/dont-include-css-js-in-frontend-that-is-not-needed/.

But my question is not answered yet. I know with that code for functions.php I found I remove the following files from your source code in the front-end:

wp-views/res/js/views_front_end_utils.js
wp-views/res/js/wpv-pagination-embedded.js
wp-views/res/js/jquery.ui.datepicker.min.js
wp-views/res/js/wpv-date-front-end-control.js
wp-views/res/css/wpv-views-sorting.css
wp-views/res/css/wpv-pagination.css

But before I implemented this in my functions.php, I have checked if I could find these files. And these three files I did not found:

- views_front_end_utils.js
- wpv-date-front-end-control.js
- wpv-views-sorting.css

Now I am trying to understand why these were not implemented in my source code. Is there something you have to do in Views before these are visible in the source code?

You also answered my 'QS3' in the last topic, but the solution you presented is not neccesarry anymore.
I found that this part of the code already did the trick:

 wp_deregister_script( 'jquery-ui-datepicker' );

Kind regards,

Willem

#259910

As web developer who focus on wordpress less than a year, this kind of practice is really wonder me. Why it seem wordpress developer does not care about script optimizing, reduce http calls, etc...

#260278

Luo Yang
Supporter

Languages: Englisch (English ) Vereinfachtes Chinesisch (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

I can not find below two file in the Views plugin folder:
views_front_end_utils.js
wpv-date-front-end-control.js

But file wpv-views-sorting.css does exist in the Views plugin folderwp-views\res\css

And the solution in mentioned in above URL:
https://toolset.com/forums/topic/remove-unneccessary-css-files/

Which is for old version of Views, The two missing files is for previous version of Views. which is useless for current version you can ignore the two files.

#260284

Thanks!

#260285

For others, here my gist: hidden link