PHP error when clicking on heart on a blog post

edited January 2016 in Theme support
This error pops up when clicking on a heart on a blog post:

Warning : setcookie() expects parameter 3 to be integer, float given in [location of server and wordpress install]/wp-content/themes/betheme/functions/class-love.php on line 65

Any way to fix this?

Thanks!

Forgot to include web address to site:

http://ajarfullofideas.com

Comments

  • Hi,

    please deactivate all your plugins first. But if this won't help, please update theme files thru FTP only and then check if this would help.

    Thanks!
  • Neither of those helped.  This is on a relatively clean installation of Wordpress and the Theme.  It seems to be an issue with the class-love.php file included with the theme that is causing this error message to pop up.
  • I was able to fix the issue.

    Code wise it was this part of line 65 that was causing the issue: time()*20

    While I don't know how long you were looking to keep the cookie for each heart around for, setting it to 30 days with this code fixed all of the issues: time()+60*60*24*30
  • This is really weird because we did never met with such issue. Over 20k of people are using this theme and so far nobody did not noticed this issue. Something must be wrong on your server side then.
  • Well I am running PHP 7.0 on my server. While most people would still be running PHP 5.x. Either something changed between PHP 5 and 7 on how it wants the time() function written out, or there is a current bug in PHP 7.0.  Otherwise I haven't had any issues with running PHP 7 with Wordpress except for this one issue.
  • That's weird. We must have a look on it then closer. And thanks for the info about PHP7.
Sign In or Register to comment.