September 3, 2018 at 1:04 pm #222901
I just updated a client site with cafe pro and am getting an error message in the Appearance > Customize screen that makes no sense to me:
Warning: A non-numeric value encountered in /[masked-directory-path]/wp-content/themes/cafe-pro/lib/customize.php on line 102
This is lines 98-105 in customize.php:
$wp_customize->add_control( new Child_Cafe_Image_Control( $wp_customize, $image .'-image', array( 'label' => sprintf( __( 'Featured Section %s Image:', 'cafe' ), $image ), 'section' => 'cafe-settings', 'settings' => $image .'-image', 'priority' => $image+1, ) ) );
Gensis ver: 2.6.1
WP ver: 4.9.8
I'm at a loss. This is exactly the same setting and theme as my dev environment, which is not throwing this error message.
Any thoughts are most appreciated.September 3, 2018 at 8:21 pm #222908
I have never encountered that type of message. But one thing to check possibly is the PHP version being used on the client site. Install this which will display the PHP version on the home Dashboard - https://wordpress.org/plugins/display-php-version/. If it's less than 5.6 then you definitely should upgrade but the newest version is 7.0.
September 4, 2018 at 4:04 am #222921
$image is not a numeric value and you are trying to add a 1 to it.
This is a warning message. Warning messages are often suppressed in a development environment, but not in production. This may be why you're not seeing it in dev.
Use a debugger like Kint to examine the value of $image within your function. Install and activate this plugin: https://wordpress.org/plugins/kint-php-debugger/
Then add d($image); to your code to see the value of $image.
September 4, 2018 at 7:20 am #222924
Cafe Pro was updated in June 2018.
The code you posted is not included in the latest version of the Cafe Pro child theme.
Here's the default code located between lines 56 - 61 of lib > customize.php :
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, $image .'-image', array( 'label' => sprintf( __( 'Featured Section %s Image:', 'cafe-pro' ), $image ), 'section' => 'cafe-settings', 'settings' => $image . '-image', 'priority' => $key + 1, ) ) );
Looks like you posted custom code.
September 8, 2018 at 2:21 pm #223069
Nope. Not custom. Just out of date. I need to download the child-theme update from June.
Thanks for the pointer!
AnneSeptember 8, 2018 at 2:22 pm #223070
Thanks, Victor. I'll try that if the child-theme update doesn't take care of the problem.
Anne 🙂May 8, 2019 at 1:44 pm #491031
When trying to upload the new version of cafe-pro-zip I get the error.
Destination folder already exists. /home/tenintys/public_html/wp-content/themes/cafe-pro/
Theme installation failed.
How can I update the theme?May 9, 2019 at 6:16 am #491058
You must be logged in to reply to this topic.