Title: Blockify Theme PHP Fatal Error
Last modified: April 16, 2025

---

# Blockify Theme PHP Fatal Error

 *  Resolved [WAMEQ](https://wordpress.org/support/users/wameq/)
 * (@wameq)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/blockify-theme-php-fatal-error/)
 * ![](https://wordpress.org/095f34ab-80b6-48ad-b057-58b8b63cf156)
 * Hi, i am having my website on this theme [https://wp-themes.com/blockify](https://wp-themes.com/blockify)
   and i guess due to WP update is stopped working. please help me with that.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fblockify-theme-php-fatal-error%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 10 replies - 1 through 10 (of 10 total)

 *  [khilaadi](https://wordpress.org/support/users/khilaadi/)
 * (@khilaadi)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/blockify-theme-php-fatal-error/#post-18419058)
 * I am experiencing the same issue for the lates WP 6.8 auto update. I had to manually
   downgrade to the previous version to get it to work again.
   Can you please provide
   guidance on what changes I need to make to enable automatic updates again?
 *  [sweethari](https://wordpress.org/support/users/sweethari/)
 * (@sweethari)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/blockify-theme-php-fatal-error/#post-18419112)
 * ✅ Step-by-Step: Fix Blockify Theme Error
    1. Open the file:
 * /wp-content/themes/blockify/patterns/utility/color-palette.php
    2. Find the function that looks like this:
       function color_palette_grid() {// function
       code here}
    3. Wrap it like this:
 * if (!function_exists(‘color_palette_grid’)) {
   function color_palette_grid() {//
   function code here}}
 * This prevents WordPress from declaring the same function twice if it’s accidentally
   included more than once.
 *  Thread Starter [WAMEQ](https://wordpress.org/support/users/wameq/)
 * (@wameq)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/blockify-theme-php-fatal-error/#post-18419349)
 * [@sweethari](https://wordpress.org/support/users/sweethari/) Thank you, working
   now!
 *  [khilaadi](https://wordpress.org/support/users/khilaadi/)
 * (@khilaadi)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/blockify-theme-php-fatal-error/#post-18420395)
 * [@sweethari](https://wordpress.org/support/users/sweethari/) I take back my earlier
   statement. It actually works now. Thanks
    -  This reply was modified 1 year, 1 month ago by [khilaadi](https://wordpress.org/support/users/khilaadi/).
 *  [andreiesc78](https://wordpress.org/support/users/andreiesc78/)
 * (@andreiesc78)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/blockify-theme-php-fatal-error/#post-18424502)
 * [@sweethari](https://wordpress.org/support/users/sweethari/) After applying the
   fix I get the following warnings on top of the site
 * **Deprecated**: preg_match(): Passing null to parameter #2 ($subject) of type
   string is deprecated in **/data/f/f/ff11316c-559e-46d7-ac96-9381521dde54/obelixbrno.
   cz/web/wp-includes/class-wp-block-parser.php** on line **252**
 * **Deprecated**: strlen(): Passing null to parameter #1 ($string) of type string
   is deprecated in **/data/f/f/ff11316c-559e-46d7-ac96-9381521dde54/obelixbrno.
   cz/web/wp-includes/class-wp-block-parser.php** on line **324**
    -  This reply was modified 1 year, 1 month ago by [andreiesc78](https://wordpress.org/support/users/andreiesc78/).
 *  [matrixmaven](https://wordpress.org/support/users/matrixmaven/)
 * (@matrixmaven)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/blockify-theme-php-fatal-error/#post-18431778)
 * I tried doing the change above, but i am still getting error. Do i need to do
   anything else?
 *  [markienl](https://wordpress.org/support/users/markienl/)
 * (@markienl)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/blockify-theme-php-fatal-error/#post-18435312)
 * I also had an issue with the wrapping, it was besause of the quotes around color_palette_grid.
   Try removing and typing them again after pasting the line.
 * if (!function_exists(**‘**color_palette_grid**’**)) {
 * by the way, the theme got updated by the developer, but didn’t solve this issue.
   Pretty weird.
 *  [citaku](https://wordpress.org/support/users/citaku/)
 * (@citaku)
 * [1 year ago](https://wordpress.org/support/topic/blockify-theme-php-fatal-error/#post-18454639)
 * Hi,
 * Here is code of this file on my site:
 *     ```wp-block-code
       <?php/** * Title: Color Palette * Slug: color-palette * Categories: utility */use Blockify\Utilities\Color;use Blockify\Utilities\Str;$global_settings = wp_get_global_settings();$color_palette   = $global_settings['color']['palette']['theme'] ?? [];$color_slugs     = wp_list_pluck( $color_palette, 'slug' );$colors          = [];$system_colors   = Color::SYSTEM_COLORS;if (!function_exists(‘color_palette_grid’)) {function color_palette_grid() {// function code here}}	$count       = count( $shades );	$columns     = $count >= 6 ? 6 : 3;	$rows        = $count > 6 ? 2 : 1;	$rows_mobile = $count > 6 ? 4 : 1;	$html = <<<HTML<!-- wp:group {"style":{"display":{"all":"grid"},"gridTemplateColumns":{"all":"repeat($columns,minmax(0,1fr))","mobile":"repeat(3,minmax(0,1fr))"},"gridTemplateRows":{"all":"repeat($rows,minmax(0,1fr))","mobile":"repeat($rows_mobile,minmax(0,1fr))"}},"layout":{"type":"flex","orientation":"grid"}} --><div class="wp-block-group">HTML;	$on_click = <<<JSnavigator.clipboard.writeText( '{hex}' );const copied = this.getElementsByClassName('has-display-none')[0];copied.classList.remove('has-display-none');copied.classList.add('has-display-block' );setTimeout(()=>{	copied.classList.remove('has-display-block');	copied.classList.add('has-display-none' );}, 1000);JS;	foreach ( $shades as $shade => $hex ) {		$color = $name . '-' . $shade;		if ( in_array( $shade, Color::SYSTEM_COLORS, true ) ) {			$color = $shade;		}		$on_click_value = Str::reduce_whitespace( Str::remove_line_breaks( str_replace( '{hex}', $hex, $on_click ) ) );		$html .= <<<HTML<!-- wp:group {"style":{"dimensions":{"minHeight":"80px"},"border":{"radius":"10px"},"position":{"all":"relative"},"overflow":{"all":"hidden"}},"gradient":"checkerboard","layout":{"type":"flex","flexWrap":"nowrap","justifyContent":"center"},"shadowPreset":"xl","onclick":"$on_click_value"} --><div class="wp-block-group has-checkerboard-gradient-background has-background has-shadow has-xl-shadow" style="border-radius:10px;min-height:80px">	<!-- wp:group {"style":{"position":{"all":"absolute"},"top":{"all":"0px"},"right":{"all":"0px"},"bottom":{"all":"0px"},"left":{"all":"0px"},"zIndex":{"all":"0"}},"backgroundColor":"$color","layout":{"type":"constrained"}} -->	<div class="wp-block-group has-$color-background-color has-background"></div>	<!-- /wp:group -->	<!-- wp:paragraph {"className":"screen-reader-text"} -->	<p class="screen-reader-text">$color: $hex</p>	<!-- /wp:paragraph -->	<!-- wp:paragraph {"className":"has-display-none","style":{"position":{"all":"relative"}},"zIndex":{"all":"1"}} -->	<p class="has-display-none">Copied!</p>	<!-- /wp:paragraph --></div><!-- /wp:group -->HTML;	}	$html .= <<<HTML</div><!-- /wp:group -->HTML;	return $html;}foreach ( $color_palette as $color ) {	$exploded = explode( '-', $color['slug'] );	$name     = $exploded[0] ?? '';	$shade    = $exploded[1] ?? '';	if ( in_array( $name, $system_colors, true ) ) {		continue;	}	if ( ! isset( $colors[ $name ] ) ) {		$colors[ $name ] = [];	}	$colors[ $name ][ $shade ] = $color['color'];}$width_50 = 'calc(50% - (var(--wp--style--block-gap) / 2))';$system   = [	'current'     => 'currentColor',	'inherit'     => 'inherit',	'transparent' => 'transparent',];?><!-- wp:group {"layout":{"type":"flex","flexWrap":"wrap","justifyContent":"space-between"}} --><div class="wp-block-group">	<?php foreach ( $colors as $color_name => $shades ) : ?>		<?php $width = count( $shades ) < 6 ? $width_50 : '100%'; ?>		<!-- wp:group {"style":{"width":{"mobile":"100%","desktop":"<?php echo esc_attr( $width ); ?>"}},"layout":{"type":"default"},"fontSize":"14"} -->		<div class="wp-block-group has-14-font-size">			<!-- wp:heading {"level":3,"textColor":"gray-400","fontSize":"16"} -->			<h3 class="wp-block-heading has-gray-400-color has-text-color has-16-font-size">				<?php echo esc_html( Str::title_case( $color_name ) ); ?>			</h3>			<!-- /wp:heading -->			<?php echo color_palette_grid( $color_name, $shades ); ?>		</div>		<!-- /wp:group -->	<?php endforeach; ?>	<!-- wp:group {"style":{"width":{"mobile":"100%","desktop":"<?php echo esc_attr( $width_50 ); ?>"}},"layout":{"type":"default"},"fontSize":"14"} -->	<div class="wp-block-group has-14-font-size">		<!-- wp:heading {"level":3,"textColor":"gray-400","fontSize":"16"} -->		<h3 class="wp-block-heading has-gray-400-color has-text-color has-16-font-size">			<?php echo esc_html( Str::title_case( 'system' ) ); ?>		</h3>		<!-- /wp:heading -->		<?php echo color_palette_grid( 'system', $system ); ?>	</div>	<!-- /wp:group --></div><!-- /wp:group -->
       ```
   
 * Can you please edit for me? tired few times no luck 🙁
 *  [franzpadula](https://wordpress.org/support/users/franzpadula/)
 * (@franzpadula)
 * [10 months, 1 week ago](https://wordpress.org/support/topic/blockify-theme-php-fatal-error/#post-18564003)
 * On July 21 2025, I confirm that I could at least restore access to my site by
   applying the aforementioned workaround, even if the fatal error (looking at logs)
   was thrown by 
   Undefined array key “search-toggle” in /data/sites/web/[mysite]/
   www/wp-includes/class-wp-block-patterns-registry.php on line 182;
 * Sadly, the whole **visual configuration** of my website appeares totally reset
   to default.
   **Is there any chance to recover it? **(i use Creatify child theme
   of Blockify, don’t know if i have to post on that forum too)
 * Also, is an update to PHP 8 planned for Blockify? The theme appears deprecated
   by current PHP version (again reading from site logs), and even the Blockify 
   Preview Page itself
   [https://wp-themes.com/blockify](https://wp-themes.com/blockify)
   still shows PHP fatal error.
 * my site: franzpadula.it
    -  This reply was modified 10 months, 1 week ago by [franzpadula](https://wordpress.org/support/users/franzpadula/).
      Reason: forgot an important detail
 *  [websolman](https://wordpress.org/support/users/websolman/)
 * (@websolman)
 * [7 months ago](https://wordpress.org/support/topic/blockify-theme-php-fatal-error/#post-18699936)
 * **Hi!** 😊
 * I ran into the same issue and found the cause — it’s not actually the function
   itself, but the _quotes_ around the function name.
 * When copying the code from the web, the quotes were automatically changed into**“
   smart quotes”**, which PHP doesn’t recognize as valid.
   Because of that, the `
   if ( ! function_exists() )` check fails, and the function gets declared twice.
 * Here’s the difference 👇
 * **❌ Wrong version (smart quotes):**
 * `if ( ! function_exists(‘color_palette_grid’) ) {`
 * **✅ Correct version (straight quotes):**
 * `if ( ! function_exists( 'color_palette_grid' ) ) {`
 * Always make sure to use **straight single quotes** `' '` in PHP — never “curly”
   ones `‘ ’`, or you’ll get a “Cannot redeclare function” error again.
 * Hope this helps someone else! 🚀

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Blockify Theme PHP Fatal Error’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/blockify/1.4.10/screenshot.png)
 * Blockify
 * [Support Threads](https://wordpress.org/support/theme/blockify/)
 * [Active Topics](https://wordpress.org/support/theme/blockify/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/blockify/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/blockify/reviews/)

 * 10 replies
 * 9 participants
 * Last reply from: [websolman](https://wordpress.org/support/users/websolman/)
 * Last activity: [7 months ago](https://wordpress.org/support/topic/blockify-theme-php-fatal-error/#post-18699936)
 * Status: resolved