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.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.