Community Forums › Forums › Archived Forums › Design Tips and Tricks › Getting error in customize functionality for Cafe Pro
Tagged: cafe pro, customize.php
- This topic has 7 replies, 5 voices, and was last updated 5 years, 5 months ago by Victor Font.
-
AuthorPosts
-
September 3, 2018 at 1:04 pm #222901adoughertyParticipant
Hi,
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.8I'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 #222908AnitaCKeymasterI 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.
Need help with customization or troubleshooting? Reach out to me.
September 4, 2018 at 4:04 am #222921Victor FontModerator$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.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?September 4, 2018 at 7:20 am #222924Brad DaltonParticipantCafe 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 #223069adoughertyParticipantNope. Not custom. Just out of date. I need to download the child-theme update from June.
Thanks for the pointer!
Anne
September 8, 2018 at 2:22 pm #223070adoughertyParticipantThanks, 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 #491031dpseoMemberWhen 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 #491058Victor FontModeratorChild themes need to be updated manually. If you're updating a theme, you should upload it through FTP.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet? -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.