Site logo

Archived topic

illegal string offset 'custom_css_post_ID' since recent update

28 replies · Started by Maarten Vandeplas on December 19, 2018

Viewing posts 1–15 of 29

Can you help me out? I'm pretty n00b :-)
Since I updated my website to Gutenberg my GeneratePress website looks pretty odd and I get a warning (illegal string offset 'custom_css_post_ID'.
I searched for the particular line:

$mods[ $name ] = apply_filters( "pre_set_theme_mod_{$name}", $value, $old_value );

Here's the link to my website: http://www.deheuvel.be
What's going wrong and how can I fix this? Many thanks!

Hmm, did you switch to a child theme/back to the parent theme from a child theme?

Your menu just looks like it's missing a menu location. Try setting it to "Primary Menu" in "Appearance > Menus".

Not sure about that notice though. Maybe try fixing the menu first and see if it goes away.

Thanks for the help, Tom.
But unfortunately I didn't change anything, just updated...
Tried to change the menu to primary as you suggested, but still the same.
I read an outdated PHP-version can be the cause, the server is running Php 5.6.38.
Maybe I should downgrade my Wordpress version until this gets updated?

Edit: in the meantime I tried to downgrade to 4.9.9 but the error was still there.

FYI: the costumizer doesn't function anymore neither, it keeps on loading.

here's the entire code

function set_theme_mod( $name, $value ) {
	$mods = get_theme_mods();
	$old_value = isset( $mods[ $name ] ) ? $mods[ $name ] : false;

	/**
	 * Filters the theme mod value on save.
	 *
	 * The dynamic portion of the hook name, <code>$name</code>, refers to the key name of
	 * the modification array. For example, 'header_textcolor', 'header_image',
	 * and so on depending on the theme options.
	 *
	 * @since 3.9.0
	 *
	 * @param string $value     The new value of the theme mod.
	 * @param string $old_value The current value of the theme mod.
	 */
	$mods[ $name ] = apply_filters( "pre_set_theme_mod_{$name}", $value, $old_value );

	$theme = get_option( 'stylesheet' );
	update_option( "theme_mods_$theme", $mods );
}

There's nothing wrong with that core code - it's just running some code on your site where the problem actually is.

Any custom functions on the site? Have you tried deactivating your plugins one by one to test for conflicts?

I tried to deactivate every plugin but it doesn't change a thing.
I found out I cannot change the menu setting anymore, when I delete certain tabs or try to add a new menu and set this as primary it just doesn't change and sometimes I get error warnings.
As I mentioned before the 'costumizer' doesn't function neither.
There must be something wrong in the menu section but I cannot find out how to reset this. I already tried to reset menu plus costumizer options as well.

Do you have any custom functions or files in a child theme?

You can set WP_DEBUG to false in your wp-config.php and the error should go away until you find the issue.

Hello, I made some steps forward by upgrading the server to PHP 7: now the costumizer is functioning properly again and all the errors are gone. However I still cannot change the primary menu nor can I change my 'site identity logo': it shows properly in the costumizer, but when I set my menu as primary menu or add my site logo and try to save nothing changes... is there any way to fix this?

Do the changes save in the Customizer? So if you leave the Customizer and come back, your logo/menu are still set?

If so, are you using a caching plugin/server caching?

Hello Tom, the changes don't save in the Customizer and I don't use caching

I'm sorry to disturb you again but unfortunately not making any progress here. When I change to an original theme the said error goes away and I can set my menu as primary menu. When activating GP theme all works fine in the customizer, but when changing the menu or the site logo it doesn't save (all the rest does save properly) and the said error always shows up - disabling plugins doesn't help :-(

Did you end up turning on WP_DEBUG as I mentioned above?

Perhaps there's some sort of weird server bug happening? Do you have another server to test on?

Hey friends,

I am also getting this error message:

Warning: Illegal string offset 'custom_css_post_id' in /var/www/vhosts/mysitehere/wp-includes/theme.php on line 1063

This is with GeneratePress 3.0.3, GP Premium 2.0.2 and Happyforms (free) 1.12.9 active. I've deactivated all other plugins, except for Jetpack and Health Check.

This archived topic is closed to new replies.