How To Optimize Image Using Function.php

Posted in: Newsmag
Post count: 152

After implement this tutorial, my server got “Internal Server Error 500”

use a plugin that can do this for you like WP Smush.it – download
add the following code at the end of the functions.php which is located in the theme folder, the code will automatically compress each thumbnail to 50%:
add_filter( 'jpeg_quality', create_function('', 'return 50;' ) );
After you add the code you need to regenerate the thumbs, for that you could use the Force Regenerate plugin.

The value 50 stands for 50%, if you want a better compression or better quality modify it and regenerate the thumbs. Experiment until you get the optimal value.

Help, please

  • This topic was modified 10 years by Syams.
Post count: 6535

Hi

The 500 error is usually a server side error meaning that there is something wrong but the server couldn’t provide more information about the problem. It is an general error usually caused by configuration issues with the websites programming, PHP or system permissions.
I found here some useful information about possible reasons of this errors and a few tips in order to fix it: http://pcsupport.about.com/od/findbyerrormessage/a/500servererror.htm
If you can’t manage to solve this issue try to make a new clean install via ftp: https://forum.tagdiv.com/newsmag-install-via-ftp/
Before making any changes in theme’s files it’s a good practice to backup the data base and the current wp-install. This is a security measure and in case something goes wrong you can always get back to the previous install. Also you can test your customizations an a local wp install, made on your computer.

Thanks!

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