In addition, here’s the code below for the customizer.php file which problem is on line 41
Below is line 1 to Line 44 of the .php code i got from my hostgator cpanel file manager after following some instructions online, just in case this may help.
<?php
/**
* zerif Theme Customizer
*
* @package zerif
*/
/**
* Add postMessage support for site title and description for the Theme Customizer.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
function zerif_customize_register( $wp_customize ) {
class Zerif_Customizer_Number_Control extends WP_Customize_Control {
public $type = ‘number’;
public function render_content() {
?>
<label>
<span class=”customize-control-title”><?php echo esc_html( $this->label ); ?></span>
<input type=”number” <?php $this->link(); ?> value=”<?php echo intval( $this->value() ); ?>” />
</label>
<?php
}
}
$wp_customize->get_setting( ‘blogname’ )->transport = ‘postMessage’;
$wp_customize->get_setting( ‘blogdescription’ )->transport = ‘postMessage’;
$wp_customize->get_setting( ‘header_textcolor’ )->transport = ‘postMessage’;
$wp_customize->get_setting( ‘custom_logo’ )->transport = ‘postMessage’;
//$wp_customize->remove_section(‘colors’);
if ( isset( $wp_customize->selective_refresh ) ) {
$wp_customize->selective_refresh->add_partial( ‘custom_logo’, array(
‘selector’ => ‘.navbar-brand’,
‘settings’ => ‘custom_logo’,
‘render_callback’ => ‘zerif_custom_logo_callback’,
));
$wp_customize->selective_refresh->add_partial( ‘zerif_bigtitle_title_2’, array(
‘selector’ => ‘.intro-text’,
‘settings’ => ‘zerif_bigtitle_title_2’,
‘render_callback’ => function() {
return get_theme_mod(‘zerif_bigtitle_title_2’);
},
) );
[Moderator note: code fixed. Please wrap code in the backtick character or use the code button.]
Thanks again!
-
This reply was modified 9 years, 6 months ago by
bdbrown.
Hi,
I’m so sorry for the late answer. That error occurs because you are using an older version of PHP, that doesn’t support that kind of code for selective refresh.
We are working on fixing this issue, and offer compatibility for lower versions of PHP. Until the next update, you can always ask your hosting provider to update the version, which also helps with other things like security related issues.
Regards,
Rodica
So the only solution is to ask our host to update their version of PHP? I have several sites that use this theme and they are all down until I can address this. Other workarounds available? I like the theme, but my host says I would need to disable it if I want the sites to come back online.