i tried to place the code to newspaper theme but iits showing me error

Posted in: Newspaper
Post count: 23

add_filter( ‘jpeg_quality’, create_function(”, ‘return 50;’ ) );

Your PHP code changes were rolled back due to an error on line 545 of file wp-content/themes/Newspaper/functions.php. Please fix and try saving again.

Uncaught Error: Call to undefined function create_function() in wp-content/themes/Newspaper/functions.php:545
Stack trace:
#0 wp-settings.php(585): include()
#1 wp-config.php(220): require_once(‘/home/…’)
#2 wp-load.php(50): require_once(‘/home/…’)
#3 wp-admin/admin.php(34): require_once(‘/home/…’)
#4 wp-admin/theme-editor.php(10): require_once(‘/home/..’)
#5 {main}
thrown

Post count: 21065

Hello!

In order to avoid misunderstandings, please provide more information(screenshots/video) about what exactly you need to achieve or what is the issue there and your website link, so I can help you efficiently.

A solution for sending a screenshot/video is this:
Download, capture, and send: https://www.techsmith.com/jing-tool.html
After making the screenshot, you will have a link; paste it here.

Thank you!

Post count: 23

i want to change image quality like for making my website speed optimized this upper code is provided by you in the article how to optimize newspaper theme but when i try to put that code in the function.php file but those the errors im getting

These Screen Shot From my website
https://pasteboard.co/q2Ue0DwRNldB.png

These ScreenShot from tag div website where ur team provided the code
https://pasteboard.co/lUbHWgvlhjLs.png

Post count: 21065

Hello!

I guess, here is the issue: https://prnt.sc/-0bHE-yq-Lua
Please check!

Thank you!

Post count: 23

but that code is provided by you tell me what i have to put there

Post count: 21065

Hello!

Check the differences: https://prnt.sc/xxCzUAu3SXQV

Thank you!

Post count: 23

but i copied the code from your website exact as they provided

Post count: 21065

Hello!

If you copy-paste, it won’t work. Correct that, and probably it will work.

Thank you!

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