Delete some css from mobile version

Posted in: Newspaper
Post count: 268

Hi

it seems to me that the mobile version of the theme only uses
…mobile/style.css

how to delete in mobile versione
…block-library/style.min.css
…td-multi-purpose/td-plugin-multi-purpose.min.css

that slow down pagespeed results from google?

thanks!

  • This topic was modified 7 years by Bintmusic.
  • This topic was modified 7 years by Bintmusic.
Post count: 35449

Hi,

I can not say for sure if there will be some improves in page-speed, what you can do is to make first a backup to these files and only after that delete theme, clear all cache and check the page speed.

Thank you!

Post count: 268

Hi Calin

I try to eliminate above css put the two follow code in
plugins\td-composer\mobile\function.php

function dequeue_my_css() {
wp_dequeue_style(‘wp-block-library-css’);
wp_deregister_style(‘wp-block-library-css’);
}
add_action(‘wp_enqueue_scripts’,’dequeue_my_css’,100);

function dequeue_my_css() {
wp_dequeue_style(‘td-plugin-multi-purpose-css’);
wp_deregister_style(‘td-plugin-multi-purpose-css’);
}
add_action(‘wp_enqueue_scripts’,’dequeue_my_css’,100);

But it doesn’t work… any suggestions?

Thanks

Post count: 35449

Hi,

If you want to remove that css code, you’ll need to delete it manually without using any functions to eliminate the code.

Thank you!

Post count: 268

Hi Calin,

what does it mean to delete it manually?

those two css are useful in the desktop version can not be deleted altogether.

I want to delete it only in the version of the mobile theme…

Thnaks

Post count: 35449

Hi,

Unfortunately you can not delete these files only for a device, also if you are using the mobile theme the desktop css will not be load, so will not be need to remove those files.

Thank you for your understanding!

Post count: 268

it will be as you say but google’s pagespeed says that they are penalizing resources for the speed on the mobile view..

thanks

Post count: 35449

Hi,

Indeed there are some indicate for eliminate render-blocking resources, but there are others elements that are slowing the mobile version -> https://www.screencast.com/t/PoWGrURa7W

Thank you!

Viewing 8 posts - 1 through 8 (of 8 total)
The forum ‘Newspaper’ is closed to new topics and replies.