No search results were found in Documentation!
If you don’t know how to edit files manually for the theme you should not attempt any minification. There is no plugin to do it properly, aside from some things which mod_pagespeed running on your server might help with.
If you’re new to HTML and webdev.
The way you “minify” a file is removing extra spaces and line breaks.
For example, open the style.css file in text editor/programmer tool (I use TextPad on Windows, and BBedit on Mac), copy all the text, paste into the CSS minifier (link provided in my prior post); hit minify button, then paste back into the style.css file.
That is what minification is. Plenty of tutorials on the topic online.
In WP config, comments looks like
/** Sets up WordPress vars and included files. */
I cover most of this in the pagespeed sticky topic from the past year using the theme. Might be worthwhile to read through that; perhaps going back to front for my later posts.
But basically, you need to manually edit the files you want to minify, then use a tool to “minify” them; then replace the files on server in theme folder, etc., with the optimized versions.
Minifying the style.css file is the simplest thing to start with.
For minification I only recommend the following, and DONE MANUALLY:
I use http://cssminifier.com/
1) remove all the comments in wp-config.php manually
2) minify the style.css file
3) minify the functions.php file
4) if not running mod_pagespeed which does it for you, then you might also consider, manually opening your main post template and remove all double spaces and comments.
these are probably the 3 most loaded files on a WordPress site, and minifying them can really help.
Also putting in your direct URLs for base URL and home URL in the wp-config.php file really helps by saving queries. Similarly direct link to your theme folder also saves queries. But that is a bit advanced. See the WordPress Codex for more info on this topic of optimizing the wp-config.php file for hard-coded PATHS on your domain.
You can *try* minification of the main java file (.js), but this doesn’t always work very well.
Try:
http://javascript-minifier.com/
http://refresh-sf.com/
Or, open the two “main” .js files and just remove all the commenting, if you want a quick and dirty optimization.
-
This reply was modified 11 years by
simchris.
Hello team,
How to minify javascript files and css files. i see you demo and you guys are using minify js and css. how you do that in my website http://www.movzio.com google pagespeed suggest minify HTML,CSS and JS. and the second issue is admin-ajax.php load to slowly can you please suggest the solution 🙂
Thank you
-Mosam
For minification I only recommend the following, and DONE MANUALLY:
I use http://cssminifier.com/
1) remove all the comments in wp-config.php manually
2) minify the style.css file
3) minify the functions.php file
4) if not running mod_pagespeed which does it for you, then you might also consider, manually opening your main post template and remove all double spaces and comments.
these are probably the 3 most loaded files on a WordPress site, and minifying them can really help.
Also putting in your direct URLs for base URL and home URL in the wp-config.php file really helps by saving queries. Similarly direct link to your theme folder also saves queries. But that is a bit advanced. See the WordPress Codex for more info on this topic of optimizing the wp-config.php file for hard-coded PATHS on your domain.
-
This reply was modified 11 years by
simchris.
Hi,
Looks like the server response time is the main issue, I also see it when checking your site with google’s pagespeed insights tool: http://developers.google.com/speed/pagespeed/insights/?url=www.toppcnews.com&tab=desktop
You could also follow their documentation for the server response time and their recommendations: https://developers.google.com/speed/docs/insights/Server
Regarding the minify option, please note that the theme doesn’t recommend using that option as it could cause issues like the one you describe however you can track the script that breaks when you minify it and use the option to ignore the part of the js which cases issues, like this one in W3TC: http://screencast.com/t/zHQtDRkKd
Also consider that the theme already uses a minfied version of theme js when using the speed booster plugin so you wont need additional minification options.
Hope this helps!
Thanks
When I enable Minify from cloudflare or any cache plug in it fucks up my sliders and they don’t work. I have no idea why they put these options when in most cases they screw your page. I managed to optimize my website more. You can have a look at it again and it works better now I guess http://www.toppcnews.com
If I enable minify from the CDN my sliders won’t work with this theme… Is it possible to get 2-3 seconds load time and Yslow of 90 for example. This is my google pagespeed test.
http://developers.google.com/speed/pagespeed/insights/?url=www.toppcnews.com&tab=desktop
What else can I improve I am really obsessed with this stuff.
Hello, i have already follow your these guidelines to speed up my site:
https://forum.tagdiv.com/page-speed-guide/
But still my score on google speed insight is 70 and 84 for mobile and desktop!
https://developers.google.com/speed/pagespeed/insights/?url=http%3A%2F%2Fwww.unbelievable-facts.com%2F
I have few questions please guide me:
1. it is showing i need to optimize CSS Delivery, i saw article about combining many css files to one, but i am not sure if it will be applicable in these 3rd part css below:
Optimize CSS Delivery of the following:
http://www.unbelievable-facts.com/…ontact-form-plugin/css/style.css?ver=4.1
http://www.unbelievable-facts.com/…ser/assets/css/js_composer.css?ver=4.3.4
http://www.unbelievable-facts.com/…content/themes/Newsmag/style.css?ver=1.2
http://www.unbelievable-facts.com/…alize/frontend/css/socialize.css?ver=4.1
first css is of contact form i am using, widget url is :
https://wordpress.org/plugins/contact-form-plugin/
please suggest me good contact form, which will not create any porb.
2nd css is of visual composer i guess, please suggest me its solution too.
2. Minify CSS for the following resources to reduce their size by 10.5KiB (16% reduction).
Minifying http://www.unbelievable-facts.com/…content/themes/Newsmag/style.css?ver=1.2 could save 9.1KiB (17% reduction) after compression.
Minifying http://www.unbelievable-facts.com/…ser/assets/css/js_composer.css?ver=4.3.4 could save 1.4KiB (13% reduction) after compression.
How can i compress them? please guide!
3.Minify JavaScript for the following resources to reduce their size by 4.8KiB (3% reduction).
Minifying http://www.unbelievable-facts.com/…assets/js/js_composer_front.js?ver=4.3.4 could save 2.1KiB (36% reduction) after compression.
Minifying https://www.gstatic.com/swiffy/v7.1.1/runtime.js could save 1.4KiB (2% reduction) after compression.
Minifying http://www.unbelievable-facts.com/…themes/Newsmag/js/td_site.min.js?ver=1.2 could save 775B (3% reduction) after compression.
Minifying http://pagead2.googlesyndication.com/…s/r20150122/r20141212/expansion_embed.js could save 512B (2% reduction) after compression.
How can i minify them? please guide?
And 1 more question, currently i am using dedicated server, should i try CDN? will it help improving page speed? if yes then how much?
This is a common problem with CSS and custom over-rides from control panels.
It’s also called the flash of unstyled text with fonts, where the same issue happens.
Basically, what happens is that the original CSS loads for a moment, then the “over ride” color you’ve specified is loaded, and in some cases for a split second, depending on speed of server and other factors, you may or may not see that.
This is not unique to any specific theme, but simply how the web works when you’re not actually editing the MAIN style sheet which is loaded first.
This is basic CSS/HTML knowledge.
But basically, the way to fully remove that issue, is to edit the style.css file and change the class for that element to the color you wish. Fairly simple. Just do a search in text editor or programmer editor and locate the style class and change the color code. Then you don’t need to put into the CSS box in the theme panel. Downside is you have to do this each theme update, but ideally this would also be the point in time where you minify the CSS anyway. And if you’re optimizing your site for Google fonts, you’d actually put the calls to the fonts at bottom of your style.css and remove them from the theme functions files. But that is a bit advanced.
Hope that helps 🙂
Check your site with GTMetrix.com and then follow all the suggests, in particular gzip/deflate, expiration headers, image optimization, remove versioning, minify your style.css, don’t use child theme, use fast server/hosting, remove all themes and plugins you’re not using except the latest twenty-fifteen theme, optimize your wp-config.php file to include absolute paths to your domain name, optimize font loading, limit loading external elements (e.g., social counters slow down page vs simple share buttons), limit number of ad networks (I’ve seen some people with six ad networks each loading java, css, and tracking code…. it’s ‘bloat’), use a local image for gravatars, etc.
I cover a number of these issues in detail in the sticky pagespeed thread. Look for my posts, and probably easier to go backwards from the end of the topic, vs from the start a year ago! 🙂
Hi,
I have checked your site again and did noticed that even if the ‘Droid Serif’ font family is set the ‘Times New Roman’ is rendered: http://screencast.com/t/qOraBNesH
I’ve also checked your page source and noticed that ‘Droid Sans’ is loaded: http://screencast.com/t/lsyHvLY3a
Please make sure that you disable html/css/js minify option as I’ve noticed you use it compressed and also disable plugins/ empty cache and purge files if you use CDN.
This should not happens if you use the latest theme version (1.4) as I have also checked this and haven’t found any issues with this, the fonts are loaded and rendered fine: http://screencast.com/t/1dSQ61HRb
If nothing solves this I suggest you re-upload your theme files via FTP using this guide: https://forum.tagdiv.com/how-to-update-theme/ and make a backup of your current theme installation in case something goes wrong.
Thanks
So, what do you suggest to Minify Js and Html?
Hi,
Yes, because we have tested the theme with it and we recommend to enable only the page cache (no database cache, no object cache, no javascript minify): http://screencast.com/t/m48agu5pTx
Also please be sure that WordPress installation have enough resources to make the caches.
Thanks
Same here. Just updated to 1.4 yesterday (Jan. 10); no other plugins updated except the two plugins included with theme (speedbooster and social). WP 4.1, everything else up to date.
So, yes, looks like a bug.
I did manually minify my style.css, but that is just basic minification and doesn’t impact stuff like the bullet points.
In “theory” we might be able to do something temporarily like
ul {list-style-type:circle; color:#000}
Hello,
The theme is not displaying correctly at all. It seems it may be an issue with W3TotalCache, as it breaks when that plugin is activated but works fine when it is deactivated. This is odd since you guys recommend W3TC in the theme documentation. I have activated W3TC so you can see what the problem look like here: http://dev3.beta.dailysundial.com/ Note that it displays just fine when I deactivate it.
Any clues as to what is causing this? Note that I tried disabling Minify options (which can mess with some themes) to no avail. I am using the latest WP release and the latest release of Newspaper. All plugins are up to date.
Thanks for your help!
Hi,
The I have checked your site an noticed that you also use html/css/js minifyed which we don’t recommend as it can cause issue of this type.
Unfortunately we haven’t made any tests with Speed Booster Pack so I can’t provide you an accurate answer on how this but you can also address this question to plugins support or you can use the tagdiv speed booster plugin which was provided within theme files: https://forum.tagdiv.com/how-to-make-the-site-faster/
Thanks
Hi,
I have also tested this using your tweet link and haven’t found any issues, the tweet looks as it should: http://screencast.com/t/cNMpDFJQ3
I have also checked your site and found that you are minifying css/js which can be the cause of this and it can also be caused by other plugins so please make sure you test this without any plugins active and without any minifying options enabled and also remember to empty cache and purge files if you use any CDN hosting services.
Please let me know if you still have issues with this after doing this.
Thanks
Hi everyone! I have a problem with my website because when its loading the nav-menu will displayed as list. Anyone can advice me? I have installed plugins like W3 Total Cache, Leverage Browser Caching Ninja, Better WordPress Minify and WP Smush.it but still showing but theres quite improvement. Cheers!
Hi,
@Ryuko We don’t recommend using the minify option for js and css also because we had numerous theme issues reported and the vast majority of them proved to occur because of minified js/css or when using CDN host services which can deliver old file content if not used right.
Taking all this into consideration we don’t recommend using the minifying option for js/css only if this are done manually and carefully studied which scripts can cause issues if minified and ignore them. This is also the reason we only recommend page cache as fro the database cache you can use MySQL Query Cache and find more info about it here: http://dev.mysql.com/doc/refman/5.1/en/query-cache.html
Unfortunately we don’t have any documentation on this or tutorials and you can enable and use the js or css minfied but you should take note of that first if you have any theme related issues and errors in your console and disable them to check if the issue is due to the minfier.
So in conclusion please note that we don’t guarantee that using js/css minification will definitely cause issues but we just don’t recommend them to be done automatically as they could case issues.
@Aedin84 If the minify settings work well for you, that’s ok, you should consider them first though if you have problems or other js conflicts.
That happens because the theme panel changes are loaded after the main styles and using the speed booster plugin moves scripts and style to the footer determining the content to loaded first the the styles.
Hope this makes sense!
Thanks
I’d also like an explanation. I use Cloudflare on my main website, but considering dropping it as sites I run with this theme on the same server (using non recommended js and css minify settings) load to perfection, while my main site loads the content first and then loads themepanel changes (fonts, background colors, etc) a few seconds later. It’s quite annoying.
Hi,
can you please explain why I shouldn’t use the minify options? I searched for guides on google for the best settings when using W3TC and CDN. All of them seem to recommend enabling minify + other options like browser/database cache.
Do you perhaps have some screenshots or maybe video going over the optimal settings in W3TC? I don’t have the minify option enabled under the W3 general settings – but if I click on the minify below the general settings
JS minify and CSS minify are enabled. Should I disable those too?
Hi,
You don’t need to disable the tagDiv Speed Booster plugin as this should all work together but please note that when using W3TC we only recommend using page cache without minifying js or css. Same with the CDN we don’t recommend any javascript minification.
If you want to do this you would need to do it manually and search and exclude the scripts which generate errors.
Thanks
Hi thanks for a great theme! I recently setup our site with MaxCDN and integrated into W3TC plugin. I read thru your documentation carefully — making sure to only use for page cache, not JS minify or anything else.
After implementing the CDN, I next tried using a plugin called Imsanity to optimize all my images. Somehow once I regenerated all my images, it seems to have broke my CSS. Especially the woocommerce product image sizes.
Our site is http://www.askdrmaxwell.com
Can you please take a look at the homepage (towards the bottom) there are 5 products, and they are supposed to be all next to each other in one row.. however now the spacing is all jumbled and not right.
Also on any individual product page, the images are now much too large! I’ve tried to set woocommerce product size in woocommerce settings.. and then use regenerate thumbnails plugin, and also reset cache. However, this does not fix the issue.
Can you please help?
Thanks again!
James
Hi,
I have a problem with my category page. It might be a bug. When I display the big grid on the category template every menu item shows up. Even the one I didn’t publish in the main menu.
I found a thread with a similar problem but I couldn’t find a solution:
https://forum.tagdiv.com/topic/all-category-name-being-displayed/
You can see the problem here: http://www.stylezebra.de/category/vorher-nachher/
I am using W3 Total cache but only enabled the page cache (no minify etc.).
Team tagdiv, do you have an advice for my problem?
Thank you,
Carolin
Hi,
Please make sure that you check if this happens without any other plugins active and also empty cache and purge files if you also use any CDN host services.
Caching could be Please also note that we only recommend using W3 Total Cache use only Page Cache. (no database cache, no object cache, no javascript minify).
Hope this helps!
Thanks